Prefer native node fetch over node-fetch (#1970)
This commit is contained in:
committed by
GitHub
parent
e66db793bf
commit
098609607b
@@ -5,7 +5,6 @@ import { createWriteStream, promises as fs } from "node:fs";
|
||||
import * as childProcess from "node:child_process";
|
||||
import * as tar from "tar";
|
||||
import * as asar from "@electron/asar";
|
||||
import fetch from "node-fetch";
|
||||
import { promises as stream } from "node:stream";
|
||||
|
||||
import riotDesktopPackageJson from "../package.json";
|
||||
@@ -125,6 +124,8 @@ async function main(): Promise<number | undefined> {
|
||||
});
|
||||
fetch(PUB_KEY_URL)
|
||||
.then((resp) => {
|
||||
if (!resp.ok) throw new Error(`unexpected response ${resp.statusText}`);
|
||||
if (!resp.body) throw new Error(`unexpected response has no body ${resp.statusText}`);
|
||||
stream.pipeline(resp.body, gpgProc.stdin!).catch(reject);
|
||||
})
|
||||
.catch(reject);
|
||||
|
||||
Reference in New Issue
Block a user