fix(cli): upload GitHub assets issue

This commit is contained in:
LongYinan 2023-01-29 16:54:33 +08:00
parent 47a0d1af3b
commit a302c9cb18
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -1,4 +1,4 @@
import { createReadStream, existsSync, statSync } from 'fs' import { existsSync, statSync } from 'fs'
import { join } from 'path' import { join } from 'path'
import { Octokit } from '@octokit/rest' import { Octokit } from '@octokit/rest'
@ -9,6 +9,7 @@ import { getNapiConfig } from './consts'
import { debugFactory } from './debug' import { debugFactory } from './debug'
import { spawn } from './spawn' import { spawn } from './spawn'
import { updatePackageJson } from './update-package' import { updatePackageJson } from './update-package'
import { readFileAsync } from './utils'
import { VersionCommand } from './version' import { VersionCommand } from './version'
const debug = debugFactory('prepublish') const debug = debugFactory('prepublish')
@ -114,7 +115,7 @@ export class PrePublishCommand extends Command {
'content-type': 'application/octet-stream', 'content-type': 'application/octet-stream',
}, },
// @ts-expect-error // @ts-expect-error
data: createReadStream(dstPath), data: await readFileAsync(dstPath),
}) })
console.info(`${chalk.green(dstPath)} upload success`) console.info(`${chalk.green(dstPath)} upload success`)
console.info( console.info(