Skip to content

Commit

Permalink
fix missing node_modules directory
Browse files Browse the repository at this point in the history
  • Loading branch information
fcannizzaro committed Nov 9, 2018
1 parent 359c49a commit 34031ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"1.2.8": "messages/1.2.8.md",
"1.3.0": "messages/1.3.0.md",
"1.4.0": "messages/1.4.0.md",
"1.4.1": "messages/1.4.1.md"
"1.4.1": "messages/1.4.1.md",
"1.4.2": "messages/1.4.2.md"
}
2 changes: 2 additions & 0 deletions messages/1.4.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Changelog
- fix missing node_modules directory
10 changes: 6 additions & 4 deletions npm-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ def node_modules_ls(file, pn):
out = out.decode().strip()
root[file] = out

out, err = exec_command(['npm', 'ls', '--parseable', '--depth=0'], root[file]).communicate()
items = out.decode().split('\n')
return [item.replace('\\', '/').split('node_modules/')[1] for item in items if 'node_modules' in item]

try:
out, err = exec_command(['npm', 'ls', '--parseable', '--depth=0'], root[file]).communicate()
items = out.decode().split('\n')
return [item.replace('\\', '/').split('node_modules/')[1] for item in items if 'node_modules' in item]
except Exception:
return []

def cwd(view):
project = re.match(r'(.*)[/\\].*', view.file_name())
Expand Down

0 comments on commit 34031ca

Please sign in to comment.