Skip to content

Commit c86ba68

Browse files
committed
fix: fix local execPowershell
1 parent b7f10af commit c86ba68

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/env/addEnv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function addEnvSystem(name: string, valGiven: string | undefined) {
3232
switch (process.platform) {
3333
case "win32": {
3434
// We do not use `execa.sync(`setx PATH "${path};%PATH%"`)` because of its character limit
35-
execPowershell(`[Environment]::SetEnvironmentVariable('${name}', '${val}', 'User')`)
35+
execPowershell(`[Environment]::SetEnvironmentVariable("${name}", "${val}", "User")`)
3636
core.info(`${name}="${val} was set in the environment."`)
3737
return
3838
}

src/utils/exec/powershell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ export function execPowershell(command: string) {
1818
throw new Error("Could not find powershell")
1919
}
2020

21-
execa.sync(`${powershell} -C "${command}"`)
21+
execa.sync(powershell, ["-c", command])
2222
}

src/utils/path/addPath.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function addPathSystem(path: string) {
3232
case "win32": {
3333
// 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
3434
execPowershell(
35-
`$USER_PATH=[Environment]::GetEnvironmentVariable('PATH', 'User'); [Environment]::SetEnvironmentVariable('PATH', \\"${path};$USER_PATH\\", 'User')`
35+
`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${path};$USER_PATH", "User")`
3636
)
3737
core.info(`${path} was added to the PATH.`)
3838
return

0 commit comments

Comments
 (0)