Invert if condition checking for existence of the axmol bin path in the user path env variable (#1275)

Make list mutable to allow for inserting new path
This commit is contained in:
RH 2023-07-16 15:51:36 +10:00 committed by GitHub
parent 1daf87c768
commit b01786ef2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -21,8 +21,8 @@ if ($IsWin) {
}
$pathList = [System.Collections.ArrayList]$env:PATH.Split(';')
if (!$pathList.IndexOf($AX_CONSOLE_BIN) -eq -1) {
$pathList = [Environment]::GetEnvironmentVariable('PATH', 'User').Split(';')
if ($pathList.IndexOf($AX_CONSOLE_BIN) -eq -1) {
$pathList = [System.Collections.ArrayList][Environment]::GetEnvironmentVariable('PATH', 'User').Split(';')
$pathList.Insert(0, $AX_CONSOLE_BIN)
$PATH = $pathList -join ';'
[Environment]::SetEnvironmentVariable('PATH', $PATH, 'User')