Skip to content

Commit

Permalink
fixed detect if running inside virtualenv
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Oct 17, 2016
1 parent 2977a70 commit 5955f60
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/base/BinaryPython.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ public function install()
$dest = Yii::getAlias('@root/' . $this->name, false);
passthru('/usr/bin/env wget ' . escapeshellarg($this->download) . ' -O ' . $dest, $exitcode);
} else {
$user = $_SERVER['VIRTUAL_ENV'] ? '' : '--user';
$exitcode = $this->controller->passthru('pip', ['install', $user, $this->package]);
$args = ['install'];
if (!$_SERVER['VIRTUAL_ENV']) {
$args[] = '--user';
}
$args[] = $this->package;
$exitcode = $this->controller->passthru('pip', $args);
}

return $exitcode;
Expand Down

0 comments on commit 5955f60

Please sign in to comment.