Skip to content

Commit

Permalink
fix: fix upload Host error
Browse files Browse the repository at this point in the history
  • Loading branch information
Caedman Ziwen Lan committed Jul 28, 2023
1 parent ec0eb16 commit dbe0d4a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/commands/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Succeed!
};
}

async uploadAssets(assetsType: AssetsType, packageId: string, auth: { host: string, token: string }) {
async uploadAssets(assetsType: AssetsType, packageId: string, auth: { host: string, token: string }, uploadHost?: string) {
const widgetRootDir = findWidgetRootDir();
const assetsDir = path.join(widgetRootDir, Config.releaseCodePath, Config.releaseAssets);
const assetsTypeDir = path.join(assetsDir, assetsType);
Expand Down Expand Up @@ -308,11 +308,11 @@ Succeed!
uploadAuth.forEach((auth, index) => {
const fileUrl = path.join(widgetRootDir, Config.releaseCodePath, fileNames[index]);
const fileEntity = fse.createReadStream(fileUrl);
allPromise.push(uploadFile(fileEntity, auth));
allPromise.push(uploadFile(fileEntity, auth, undefined, uploadHost));
this.log(`uploading ${fileNames[index]}`);
});
await Promise.all(allPromise);
await uploadNotify({ auth, opt: { resourceKeys: uploadAuth.map(v => v.token) }});
await uploadNotify({ auth, opt: { resourceKeys: uploadAuth.map(v => v.token) } });
}
cli.action.stop();
}
Expand Down Expand Up @@ -356,7 +356,7 @@ Succeed!

async run() {
const parsed = this.parse(Release);
let { args: { packageId }, flags: { version, global: globalFlag, spaceId, openSource, host, token, ci, uploadHost }} = parsed;
let { args: { packageId }, flags: { version, global: globalFlag, spaceId, openSource, host, token, ci, uploadHost } } = parsed;

// let { packageId, host, token } = await autoPrompt(parsed);
packageId = this.getPackageId(packageId, globalFlag);
Expand Down Expand Up @@ -475,7 +475,7 @@ Succeed!
}
this.log();

await this.uploadAssets(AssetsType.Images, packageId, { host, token });
await this.uploadAssets(AssetsType.Images, packageId, { host, token }, uploadHost);

const [releaseCodeBundleToken, sourceCodeBundleToken] = await uploadPackageBundle(
{ releaseCodeBundle, sourceCodeBundle }, { version, packageId, uploadHost }, { host, token }
Expand Down

0 comments on commit dbe0d4a

Please sign in to comment.