mirror of https://github.com/aminya/setup-cpp
fix: fix addPathSystem/addEnvSystem fallback
This commit is contained in:
parent
a4e2df0c28
commit
777ee3fd6d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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.`)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue