Skip to content

Commit 7bc348b

Browse files
committed
use the user's current shell as the default interpreter in the hook script
1 parent 4922a3f commit 7bc348b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

virtualenvwrapper/make_hooks.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
LOCAL_HOOKS = [
5050
# deactivate
5151
("predeactivate",
52-
"This hook is run before the virtualenv is deactivated."),
52+
"This hook is run before this virtualenv is deactivated."),
5353
("postdeactivate",
54-
"This hook is run after the virtualenv is deactivated."),
54+
"This hook is run after this virtualenv is deactivated."),
5555

5656
# activate
5757
("preactivate",
58-
"This hook is run before the virtualenv is activated."),
58+
"This hook is run before this virtualenv is activated."),
5959
("postactivate",
60-
"This hook is run after the virtualenv is activated."),
60+
"This hook is run after this virtualenv is activated."),
6161
]
6262

6363
def make_hook(filename, comment):
@@ -70,10 +70,10 @@ def make_hook(filename, comment):
7070
if not os.path.exists(filename):
7171
log.info('Creating %s', filename)
7272
with open(filename, 'wt') as f:
73-
f.write("""#!/bin/sh
74-
# %s
73+
f.write("""#!%(shell)s
74+
# %(comment)s
7575
76-
""" % comment)
76+
""" % {'comment':comment, 'shell':os.environ.get('SHELL', '/bin/sh')})
7777
os.chmod(filename, PERMISSIONS)
7878
return
7979

0 commit comments

Comments
 (0)