fix: fix bug in the Windows local PATH variable name

This commit is contained in:
Amin Yahyaabadi 2023-01-15 01:48:12 -08:00
parent f1f2460b85
commit 4e183b6107
6 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -32,7 +32,7 @@ importers:
escape-path-with-spaces: github:aminya/escape-path-with-spaces#d9f81ee649203ddc55783a2f96ada59df06118e3
escape-quotes: ^1.0.2
escape-string-regexp: ^5.0.0
eslint: ^8.32.0
eslint: ^8.28.0
eslint-config-atomic: ^1.18.2
exec-powershell: workspace:1.0.0
execa: ^5.1.1

View File

@ -93,7 +93,7 @@ async function addPathSystem(path: string) {
case "win32": {
// We do not use `execa.sync(`setx PATH "${path};%PATH%"`)` because of its character limit and also because %PATH% is different for user and system
await execPowershell(
`$USER_PATH=([Environment]::GetEnvironmentVariable("patha", "User")); [Environment]::SetEnvironmentVariable("patha", "${path};$USER_PATH", "User")`
`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${path};$USER_PATH", "User")`
)
info(`"${path}" was added to the PATH.`)
return