fix: do not pani on addAptKey server errors

This commit is contained in:
Amin Yahyaabadi 2023-06-28 16:45:32 -07:00
parent 201ecd0a36
commit 67a5cc536b
5 changed files with 27 additions and 22 deletions

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

View File

@ -123,6 +123,7 @@ function initGpg() {
}
export async function addAptKeyViaServer(keys: string[], name: string, server = "keyserver.ubuntu.com") {
try {
const fileName = `/etc/apt/trusted.gpg.d/${name}`
if (!(await pathExists(fileName))) {
initGpg()
@ -143,6 +144,10 @@ export async function addAptKeyViaServer(keys: string[], name: string, server =
)
}
return fileName
} catch (err) {
warning(`Failed to add apt key via server ${server}: ${err}`)
return undefined
}
}
export async function addAptKeyViaDownload(name: string, url: string) {