We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 897ae17 commit 30ee22fCopy full SHA for 30ee22f
virtualenvwrapper/user_scripts.py
@@ -26,13 +26,23 @@
26
script_folder = 'bin'
27
28
29
+def _get_msys_shell():
30
+ if 'MSYS_HOME' in os.environ:
31
+ return [get_path(os.environ['MSYS_HOME'], 'bin', 'sh.exe')]
32
+ else:
33
+ for path in os.environ['PATH'].split(';'):
34
+ if os.path.exists(os.path.join(path, 'sh.exe')):
35
+ return [get_path(path, 'sh.exe')]
36
+ raise Exception('Could not find sh.exe')
37
+
38
39
def run_script(script_path, *args):
40
"""Execute a script in a subshell.
41
"""
42
if os.path.exists(script_path):
43
cmd = [script_path] + list(args)
44
if is_msys:
- cmd = [get_path(os.environ['MSYS_HOME'], 'bin', 'sh.exe')] + cmd
45
+ cmd = _get_msys_shell() + cmd
46
log.debug('running %s', str(cmd))
47
try:
48
subprocess.call(cmd)
0 commit comments