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
|
const val = shouldEscapeSpace ? escapeSpace(valGiven) : valGiven
|
||||||
try {
|
try {
|
||||||
if (isGitHubCI()) {
|
if (isGitHubCI()) {
|
||||||
|
try {
|
||||||
exportVariable(name, val)
|
exportVariable(name, val)
|
||||||
|
} catch (err) {
|
||||||
|
error(err as Error)
|
||||||
|
await addEnvSystem(name, val)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
await addEnvSystem(name, val)
|
await addEnvSystem(name, val)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
try {
|
|
||||||
error(err as Error)
|
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.`)
|
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}`
|
process.env.PATH = `${path}${delimiter}${process.env.PATH}`
|
||||||
try {
|
try {
|
||||||
if (isGitHubCI()) {
|
if (isGitHubCI()) {
|
||||||
|
try {
|
||||||
ghAddPath(path)
|
ghAddPath(path)
|
||||||
|
} catch (err) {
|
||||||
|
error(err as Error)
|
||||||
|
await addPathSystem(path)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
await addPathSystem(path)
|
await addPathSystem(path)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
try {
|
|
||||||
error(err as Error)
|
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.`)
|
setFailed(`Failed to add ${path} to the percistent PATH. You should add it manually.`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue