Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2017-09-06 17:07:18 -04:00
parent a82cac8d7b
commit 96ba437dd1
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -3,4 +3,4 @@
# //___/ / / / //___/ / // // / / || / /
# // / / // ((____ // / / ||/ /
__version__ = '5.4.1'
__version__ = '5.4.2'
+6 -2
View File
@@ -1058,8 +1058,6 @@ def shell(three=None, python=False, compat=False, shell_args=None):
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
print(locals())
# Set an environment variable, so we know we're in the environment.
os.environ['PIPENV_ACTIVE'] = '1'
@@ -1142,6 +1140,12 @@ def run(command, args, three=None, python=False):
command_path = which(command)
# Activate virtualenv under the current interpreter's environment
activate_this = which('activate_this.py')
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
if not os.path.exists(command_path):
click.echo(crayons.red('The command ({0}) was not found within the virtualenv!'.format(command_path)))
sys.exit(1)