Skip to content

Commit 3ff62e9

Browse files
committed
Enforce consistency between *pendenv methods
Signed-off-by: javrin <[email protected]>
1 parent ae11f37 commit 3ff62e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rezplugins/shell/_utils/powershell_base.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ def prependenv(self, key, value):
290290

291291
# Be careful about ambiguous case in pwsh on Linux where pathsep is :
292292
# so that the ${ENV:VAR} form has to be used to not collide.
293+
# The nested Get-ChildItem call is set to SilentlyContinue to prevent
294+
# an exception of the Environment Variable is not set already
293295
self._addline(
294296
'Set-Item -Path "Env:{0}" -Value ("{1}{2}" + (Get-ChildItem -ErrorAction SilentlyContinue "Env:{0}").Value)'
295297
.format(key, value, self.pathsep)
@@ -304,7 +306,7 @@ def appendenv(self, key, value):
304306
# an exception of the Environment Variable is not set already
305307
self._addline(
306308
'Set-Item -Path "Env:{0}" -Value ((Get-ChildItem -ErrorAction SilentlyContinue "Env:{0}").Value + "{1}{2}")'
307-
.format(key, os.path.pathsep, value))
309+
.format(key, self.pathsep, value))
308310

309311
def unsetenv(self, key):
310312
self._addline(

0 commit comments

Comments
 (0)