Skip to content

Commit 460582d

Browse files
committed
Fix node in no-node-case...again.
1 parent 5a0d35d commit 460582d

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

pre_commit/languages/node.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ def install_environment(repo_cmd_runner):
3838
with clean_path_on_failure(repo_cmd_runner.path(ENVIRONMENT_DIR)):
3939
# Try and use the system level node executable first
4040
try:
41-
python_env.run(
42-
'nodeenv -n system {{prefix}}{0}'.format(ENVIRONMENT_DIR),
43-
)
41+
with clean_path_on_failure(repo_cmd_runner.path(ENVIRONMENT_DIR)):
42+
python_env.run(
43+
'nodeenv -n system {{prefix}}{0}'.format(ENVIRONMENT_DIR),
44+
)
4445
except CalledProcessError:
4546
# TODO: log failure here
46-
# cleanup
47-
# TODO: local.path(ENVIRONMENT_DIR).delete()
4847
python_env.run(
4948
'nodeenv --jobs 4 {{prefix}}{0}'.format(ENVIRONMENT_DIR),
5049
)

0 commit comments

Comments
 (0)