Permalink
Browse files

activate.ps1: Look for python.exe inside PCBuild and PBBuild\amd64.

  • Loading branch information...
1 parent 16bd172 commit 519b8e9dfddc2cc16dbd33fd1de8aef294836891 Henri Wiechers committed Nov 24, 2011
Showing with 14 additions and 1 deletion.
  1. +14 −1 bin/activate.ps1
View
@@ -80,7 +80,20 @@ if (!$PyInstallPathKey) {
}
$script:PyInstallPath = $PyInstallPathKey.GetValue('');
-$Env:Path="$PyInstallPath;$Env:Path"
+ForEach($subdir in @('', 'PCBuild', 'PCBuild\amd64')) {
+ $script:PyExeDir = Join-Path $PyInstallPath $_;
+ $script:PyExePath = Join-Path $PyExeDir python.exe;
+ if (Test-Path $PyExePath) {
+ break;
+ }
+}
+
+if (!$PyExePath) {
+ "Error: Unable to find python.exe in installation path " + $PyInstallPath
+ return;
+}
+
+$Env:Path="$PyExeDir;$Env:Path"
function global:_OLD_VIRTUAL_PROMPT {};
Set-Content Function:_OLD_VIRTUAL_PROMPT (Get-Content Function:Prompt);

0 comments on commit 519b8e9

Please sign in to comment.