Skip to content

Commit

Permalink
chore: 修复 download.js 脚本在 Windows 创建文件时出现 ? 非法字符 (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
fankangsong authored Jul 3, 2023
1 parent 54ddd33 commit 7f44ddf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/download.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const querystring = require('querystring');
const rimraf = require('rimraf');
const fs = require('fs-extra');
const compressing = require('compressing');
Expand Down Expand Up @@ -61,7 +62,9 @@ const parallelRunPromise = (lazyPromises, n) => {

async function downloadExtension(url, namespace, extensionName) {
const tmpPath = path.join(os.tmpdir(), 'extension');
const tmpZipFile = path.join(tmpPath, path.basename(url));
const [tempFileName, queryStr] = path.basename(url).split('?');
const { version = '' } = querystring.parse(queryStr);
const tmpZipFile = path.join(tmpPath, `${tempFileName}-${version}`);
await fs.mkdirp(tmpPath);

const tmpStream = fs.createWriteStream(tmpZipFile);
Expand Down

0 comments on commit 7f44ddf

Please sign in to comment.