@@ -55,10 +55,10 @@ function Set-SpackEnv {
55
55
56
56
function Invoke-SpackCD {
57
57
if (Compare-CommonArgs $SpackSubCommandArgs ) {
58
- python $Env: SPACK_ROOT / bin/ spack cd - h
58
+ python " $Env: SPACK_ROOT /bin/spack" cd - h
59
59
}
60
60
else {
61
- $LOC = $ (python $Env: SPACK_ROOT / bin/ spack location $SpackSubCommandArgs )
61
+ $LOC = $ (python " $Env: SPACK_ROOT /bin/spack" location $SpackSubCommandArgs )
62
62
if (($NULL -ne $LOC )){
63
63
if ( Test-Path - Path $LOC ){
64
64
Set-Location $LOC
@@ -75,54 +75,53 @@ function Invoke-SpackCD {
75
75
76
76
function Invoke-SpackEnv {
77
77
if (Compare-CommonArgs $SpackSubCommandArgs [0 ]) {
78
- python $Env: SPACK_ROOT / bin/ spack env - h
78
+ python " $Env: SPACK_ROOT /bin/spack" env - h
79
79
}
80
80
else {
81
81
$SubCommandSubCommand = $SpackSubCommandArgs [0 ]
82
82
$SubCommandSubCommandArgs = $SpackSubCommandArgs [1 .. $SpackSubCommandArgs.Count ]
83
83
switch ($SubCommandSubCommand ) {
84
84
" activate" {
85
85
if (Compare-CommonArgs $SubCommandSubCommandArgs ) {
86
- python $Env: SPACK_ROOT / bin/ spack env activate $SubCommandSubCommandArgs
86
+ python " $Env: SPACK_ROOT /bin/spack" env activate $SubCommandSubCommandArgs
87
87
}
88
88
elseif ([bool ]($SubCommandSubCommandArgs.Where ({$_ -eq " --pwsh" }))) {
89
- python $Env: SPACK_ROOT / bin/ spack env activate $SubCommandSubCommandArgs
89
+ python " $Env: SPACK_ROOT /bin/spack" env activate $SubCommandSubCommandArgs
90
90
}
91
91
elseif (! $SubCommandSubCommandArgs ) {
92
- python $Env: SPACK_ROOT / bin/ spack env activate $SubCommandSubCommandArgs
92
+ python " $Env: SPACK_ROOT /bin/spack" env activate $SubCommandSubCommandArgs
93
93
}
94
94
else {
95
- $SpackEnv = $ (python $Env: SPACK_ROOT / bin/ spack $SpackCMD_params env activate " --pwsh" $SubCommandSubCommandArgs )
95
+ $SpackEnv = $ (python " $Env: SPACK_ROOT /bin/spack" $SpackCMD_params env activate " --pwsh" $SubCommandSubCommandArgs )
96
96
Set-SpackEnv $SpackEnv
97
97
}
98
98
}
99
99
" deactivate" {
100
100
if ([bool ]($SubCommandSubCommandArgs.Where ({$_ -eq " --pwsh" }))) {
101
- python $Env: SPACK_ROOT / bin/ spack env deactivate $SubCommandSubCommandArgs
101
+ python" $Env: SPACK_ROOT /bin/spack" env deactivate $SubCommandSubCommandArgs
102
102
}
103
103
elseif ($SubCommandSubCommandArgs ) {
104
- python $Env: SPACK_ROOT / bin/ spack env deactivate - h
104
+ python " $Env: SPACK_ROOT /bin/spack" env deactivate - h
105
105
}
106
106
else {
107
- $SpackEnv = $ (python $Env: SPACK_ROOT / bin/ spack $SpackCMD_params env deactivate " --pwsh" )
107
+ $SpackEnv = $ (python " $Env: SPACK_ROOT /bin/spack" $SpackCMD_params env deactivate " --pwsh" )
108
108
Set-SpackEnv $SpackEnv
109
109
}
110
110
}
111
- default {python $Env: SPACK_ROOT / bin/ spack $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs }
111
+ default {python " $Env: SPACK_ROOT /bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs }
112
112
}
113
113
}
114
114
}
115
115
116
116
function Invoke-SpackLoad {
117
117
if (Compare-CommonArgs $SpackSubCommandArgs ) {
118
- python $Env: SPACK_ROOT / bin/ spack $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs
118
+ python " $Env: SPACK_ROOT /bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs
119
119
}
120
120
elseif ([bool ]($SpackSubCommandArgs.Where ({($_ -eq " --pwsh" ) -or ($_ -eq " --list" )}))) {
121
- python $Env: SPACK_ROOT / bin/ spack $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs
121
+ python " $Env: SPACK_ROOT /bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs
122
122
}
123
123
else {
124
- # python $Env:SPACK_ROOT/bin/spack $SpackCMD_params $SpackSubCommand "--pwsh" $SpackSubCommandArgs
125
- $SpackEnv = $ (python $Env: SPACK_ROOT / bin/ spack $SpackCMD_params $SpackSubCommand " --pwsh" $SpackSubCommandArgs )
124
+ $SpackEnv = $ (python " $Env: SPACK_ROOT /bin/spack" $SpackCMD_params $SpackSubCommand " --pwsh" $SpackSubCommandArgs )
126
125
Set-SpackEnv $SpackEnv
127
126
}
128
127
}
@@ -131,7 +130,7 @@ function Invoke-SpackLoad {
131
130
$SpackCMD_params , $SpackSubCommand , $SpackSubCommandArgs = Read-SpackArgs $args
132
131
133
132
if (Compare-CommonArgs $SpackCMD_params ) {
134
- python $Env: SPACK_ROOT / bin/ spack $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs
133
+ python " $Env: SPACK_ROOT /bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs
135
134
exit $LASTEXITCODE
136
135
}
137
136
@@ -143,5 +142,5 @@ switch($SpackSubCommand)
143
142
" env" {Invoke-SpackEnv }
144
143
" load" {Invoke-SpackLoad }
145
144
" unload" {Invoke-SpackLoad }
146
- default {python $Env: SPACK_ROOT / bin/ spack $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs }
145
+ default {python " $Env: SPACK_ROOT /bin/spack" $SpackCMD_params $SpackSubCommand $SpackSubCommandArgs }
147
146
}
0 commit comments