mirror of https://github.com/aminya/setup-cpp.git
fix: error on unmatched apt package version by default
This commit is contained in:
parent
0c09b5d740
commit
40c2ffd2be
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
|
|
@ -87,11 +87,16 @@ async function getAptArg(apt: string, pack: AptPackage) {
|
|||
return `${name}-${version}`
|
||||
case AptPackageType.NameEqualsVersion:
|
||||
return `${name}=${version}`
|
||||
case AptPackageType.Name:
|
||||
if (version !== undefined && version !== "" && fallBackToLatest) {
|
||||
warning(`Could not find package '${name}' with version '${version}'. Installing the latest version.`)
|
||||
case AptPackageType.Name: {
|
||||
if (version === undefined) {
|
||||
return name
|
||||
}
|
||||
return name
|
||||
if (fallBackToLatest) {
|
||||
warning(`Could not find package '${name}' with version '${version}'. Installing the latest version.`)
|
||||
return name
|
||||
}
|
||||
throw new Error(`Could not find package '${name}' with version '${version}'`)
|
||||
}
|
||||
default:
|
||||
throw new Error(`Could not find package '${name}' ${version ?? "with unspecified version"}`)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue