diff --git a/src/commands/update.ts b/src/commands/update.ts index 377f97bd..e7ae1d6a 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -62,7 +62,7 @@ export default class UpdateCommand extends Command { const {version, channel} = manifest cli.action.start(`${this.config.name}: Updating CLI from ${color.green(this.config.version)} to ${color.green(version)}${channel === 'stable' ? '' : ' (' + color.yellow(channel) + ')'}`) const http: typeof HTTP = require('http-call').HTTP - const filesize = require('filesize') + const filesize = require('filesize').partial({unix: true}) const output = path.join(this.clientRoot, version) const {response: stream} = await http.stream(manifest.gz) diff --git a/src/tar.ts b/src/tar.ts index 7a7f6f6c..84b7c804 100644 --- a/src/tar.ts +++ b/src/tar.ts @@ -8,7 +8,7 @@ const debug = require('debug')('oclif-update') export async function extract(stream: NodeJS.ReadableStream, basename: string, output: string, sha?: string) { const getTmp = () => `${output}.partial.${Math.random().toString().split('.')[1].slice(0, 5)}` let tmp = getTmp() - if (await fs.pathExists(tmp)) tmp = getTmp() + if (fs.pathExistsSync(tmp)) tmp = getTmp() debug(`extracting to ${tmp}`) try { await new Promise((resolve, reject) => {