From a302c9cb18710d8d71045d11780f09d4eaf1ecde Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sun, 29 Jan 2023 16:54:33 +0800 Subject: [PATCH] fix(cli): upload GitHub assets issue --- cli/src/pre-publish.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/src/pre-publish.ts b/cli/src/pre-publish.ts index 6533373300..4e99568c56 100644 --- a/cli/src/pre-publish.ts +++ b/cli/src/pre-publish.ts @@ -1,4 +1,4 @@ -import { createReadStream, existsSync, statSync } from 'fs' +import { existsSync, statSync } from 'fs' import { join } from 'path' import { Octokit } from '@octokit/rest' @@ -9,6 +9,7 @@ import { getNapiConfig } from './consts' import { debugFactory } from './debug' import { spawn } from './spawn' import { updatePackageJson } from './update-package' +import { readFileAsync } from './utils' import { VersionCommand } from './version' const debug = debugFactory('prepublish') @@ -114,7 +115,7 @@ export class PrePublishCommand extends Command { 'content-type': 'application/octet-stream', }, // @ts-expect-error - data: createReadStream(dstPath), + data: await readFileAsync(dstPath), }) console.info(`${chalk.green(dstPath)} upload success`) console.info(