There was an error while loading. Please reload this page.
1 parent c300a11 commit d4c9f90Copy full SHA for d4c9f90
2 files changed
pre_commit/languages/helpers.py
@@ -24,7 +24,7 @@ def env_prefix(self):
24
"""
25
raise NotImplementedError
26
27
- def run(self, cmd, stdin=None, **kwargs):
+ def run(self, cmd, stdin=None):
28
"""Returns (returncode, stdout, stderr)."""
29
proc = subprocess.Popen(
30
['bash', '-c', ' '.join([self.env_prefix, cmd])],
pre_commit/languages/node.py
@@ -31,13 +31,12 @@ def install_environment():
31
with python.in_env() as python_env:
32
python_env.run('pip install nodeenv')
33
34
- try:
35
- # Try and use the system level node executable first
36
- python_env.run('nodeenv -n system {0}'.format(NODE_ENV))
37
- except Exception:
38
- # TODO: log exception here
39
- # cleanup
40
- local.path(NODE_ENV).remove()
+ # Try and use the system level node executable first
+ retcode, _, _ = python_env.run('nodeenv -n system {0}'.format(NODE_ENV))
+ # TODO: log failure here
+ # cleanup
+ if retcode:
+ local.path(NODE_ENV).delete()
41
python_env.run('nodeenv --jobs 4 {0}'.format(NODE_ENV))
42
43
with in_env() as node_env:
0 commit comments