mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 12:30:08 -06:00
Fix node runner for running without a system-level node installed.
This commit is contained in:
@@ -31,13 +31,12 @@ def install_environment():
|
||||
with python.in_env() as python_env:
|
||||
python_env.run('pip install nodeenv')
|
||||
|
||||
try:
|
||||
# Try and use the system level node executable first
|
||||
python_env.run('nodeenv -n system {0}'.format(NODE_ENV))
|
||||
except Exception:
|
||||
# TODO: log exception here
|
||||
# cleanup
|
||||
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()
|
||||
python_env.run('nodeenv --jobs 4 {0}'.format(NODE_ENV))
|
||||
|
||||
with in_env() as node_env:
|
||||
|
||||
Reference in New Issue
Block a user