Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f909deb

Browse files
authored
Merge pull request #578 from Lucas-C/master
NodeJS hooks compatibilty fix for Cygwin - fix #455
2 parents a3f7b40 + 5f3e162 commit f909deb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pre_commit/languages/node.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717

1818

1919
def get_env_patch(venv): # pragma: windows no cover
20+
config = os.path.join(venv, 'bin') if sys.platform == 'cygwin' else venv
2021
return (
2122
('NODE_VIRTUAL_ENV', venv),
22-
('NPM_CONFIG_PREFIX', venv),
23-
('npm_config_prefix', venv),
23+
('NPM_CONFIG_PREFIX', config),
24+
('npm_config_prefix', config),
2425
('NODE_PATH', os.path.join(venv, 'lib', 'node_modules')),
2526
('PATH', (os.path.join(venv, 'bin'), os.pathsep, Var('PATH'))),
2627
)

0 commit comments

Comments
 (0)