fix: fix addPathSystem/addEnvSystem fallback

This commit is contained in:
Amin Yahyaabadi 2022-05-12 17:38:39 -07:00
parent a4e2df0c28
commit 777ee3fd6d
3 changed files with 16 additions and 16 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,17 +12,17 @@ export async function addEnv(name: string, valGiven: string | undefined, shouldE
const val = shouldEscapeSpace ? escapeSpace(valGiven) : valGiven
try {
if (isGitHubCI()) {
try {
exportVariable(name, val)
} catch (err) {
error(err as Error)
await addEnvSystem(name, val)
}
} else {
await addEnvSystem(name, val)
}
} catch (err) {
try {
error(err as Error)
return addEnvSystem(name, val)
} catch (err2) {
error(err2 as Error)
}
setFailed(`Failed to export environment variable ${name}=${val}. You should add it manually.`)
}
}
@ -32,17 +32,17 @@ export async function addPath(path: string) {
process.env.PATH = `${path}${delimiter}${process.env.PATH}`
try {
if (isGitHubCI()) {
try {
ghAddPath(path)
} catch (err) {
error(err as Error)
await addPathSystem(path)
}
} else {
await addPathSystem(path)
}
} catch (err) {
try {
error(err as Error)
return addPathSystem(path)
} catch (err2) {
error(err2 as Error)
}
setFailed(`Failed to add ${path} to the percistent PATH. You should add it manually.`)
}
}