mirror of https://github.com/aminya/setup-cpp
fix: do not pani on addAptKey server errors
This commit is contained in:
parent
201ecd0a36
commit
67a5cc536b
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
|
@ -123,6 +123,7 @@ function initGpg() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function addAptKeyViaServer(keys: string[], name: string, server = "keyserver.ubuntu.com") {
|
export async function addAptKeyViaServer(keys: string[], name: string, server = "keyserver.ubuntu.com") {
|
||||||
|
try {
|
||||||
const fileName = `/etc/apt/trusted.gpg.d/${name}`
|
const fileName = `/etc/apt/trusted.gpg.d/${name}`
|
||||||
if (!(await pathExists(fileName))) {
|
if (!(await pathExists(fileName))) {
|
||||||
initGpg()
|
initGpg()
|
||||||
|
@ -143,6 +144,10 @@ export async function addAptKeyViaServer(keys: string[], name: string, server =
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return fileName
|
return fileName
|
||||||
|
} catch (err) {
|
||||||
|
warning(`Failed to add apt key via server ${server}: ${err}`)
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function addAptKeyViaDownload(name: string, url: string) {
|
export async function addAptKeyViaDownload(name: string, url: string) {
|
||||||
|
|
Loading…
Reference in New Issue