build: fix publish-to-npm script post requests migration

This commit is contained in:
Samuel Attard 2021-08-13 13:26:27 -07:00
parent a11a234eac
commit 0c1f762119
No known key found for this signature in database
GPG key ID: FB94249299E904FE
2 changed files with 3 additions and 1 deletions

View file

@ -30,7 +30,7 @@ async function getAssetContents (repo, assetId) {
}
const fileResponse = await got(response.headers.location);
if (fileResponse.status !== 200) {
if (fileResponse.statusCode !== 200) {
console.error(fileResponse.headers, `${fileResponse.body}`.slice(0, 300));
throw new Error(`cannot download asset[${assetId}] from ${response.headers.location}, got status: ${fileResponse.status}`);
}

View file

@ -100,6 +100,8 @@ new Promise((resolve, reject) => {
);
fs.writeFileSync(path.join(tempDir, 'electron.d.ts'), typingsContent);
return release;
})
.then(async (release) => {
const currentBranch = await getCurrentBranch();