File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -88,10 +88,9 @@ func createEnv(name string, pythonVersion string) {
8888// Returns activation script as string, with OS-specific syntax
8989func generateActivateScript (envPath string ) string {
9090 if runtime .GOOS == "windows" {
91- return fmt .Sprintf (`@echo off
92- set "UVE_OLD_PATH=%%PATH%%"
93- set "VIRTUAL_ENV=%s"
94- set "PATH=%s\Scripts;%%PATH%%"
91+ return fmt .Sprintf (`$env:UVE_OLD_PATH = $env:PATH
92+ $env:VIRTUAL_ENV = "%s"
93+ $env:PATH = "%s\Scripts;" + $env:PATH
9594` , envPath , envPath )
9695 }
9796 return fmt .Sprintf (`export UVE_OLD_PATH="$PATH"
@@ -105,12 +104,11 @@ export PATH="%s/bin:$PATH"
105104// Returns deactivation script as string, with OS-specific syntax
106105func generateDeactivateScript () string {
107106 if runtime .GOOS == "windows" {
108- return `@echo off
109- if defined UVE_OLD_PATH (
110- set "PATH=%UVE_OLD_PATH%"
111- set "UVE_OLD_PATH="
112- )
113- set "VIRTUAL_ENV="
107+ return `if ($env:UVE_OLD_PATH) {
108+ $env:PATH = $env:UVE_OLD_PATH
109+ Remove-Item Env:\UVE_OLD_PATH
110+ }
111+ Remove-Item Env:\VIRTUAL_ENV -ErrorAction SilentlyContinue
114112`
115113 }
116114 return `if [ -n "$UVE_OLD_PATH" ]; then
You can’t perform that action at this time.
0 commit comments