Conform to no-floating-promises (#1725)

This commit is contained in:
Michael Telatynski
2024-06-12 17:17:24 +01:00
committed by GitHub
parent 5c23a23f39
commit 2018a51469
8 changed files with 22 additions and 20 deletions

View File

@@ -114,7 +114,7 @@ async function main(): Promise<number | undefined> {
return 1;
}
await new Promise<boolean>((resolve) => {
await new Promise<boolean>((resolve, reject) => {
const gpgProc = childProcess.execFile("gpg", ["--import"], (error) => {
if (error) {
console.log("Failed to import key", error);
@@ -123,9 +123,11 @@ async function main(): Promise<number | undefined> {
}
resolve(!error);
});
fetch(PUB_KEY_URL).then((resp) => {
stream.pipeline(resp.body, gpgProc.stdin!);
});
fetch(PUB_KEY_URL)
.then((resp) => {
stream.pipeline(resp.body, gpgProc.stdin!).catch(reject);
})
.catch(reject);
});
return 0;
}