Skip to content

Commit

Permalink
Merge pull request #38 from devsapp/fix-gwh
Browse files Browse the repository at this point in the history
fix:layer support cn-heyuan-acdr-1
  • Loading branch information
rsonghuster authored Jan 15, 2025
2 parents 94f1a30 + af8fd18 commit 5be80ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/subCommands/layer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,11 @@ export default class Layer {
logger.debug(`The layer code ${fileName} already exists locally, skip the download`);
return fileName;
}
const codeUrl = url.replace('-internal.aliyuncs.com', '.aliyuncs.com');
let codeUrl = url;
if (process.env.FC_REGION !== this.region && this.region !== 'cn-heyuan-acdr-1'){
codeUrl = url.replace('-internal.aliyuncs.com', '.aliyuncs.com');
}

await downloads(codeUrl, {
dest: localDir,
filename: version,
Expand Down
7 changes: 6 additions & 1 deletion src/subCommands/sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ export default class Sync {
await fs_extra.removeSync(codePath);
logger.debug(`clear sync code path: ${codePath}`);

await downloads(url, {
let codeUrl = url;
if (process.env.FC_REGION === this.region){
codeUrl = url.replace('.aliyuncs.com', '-internal.aliyuncs.com');
}

await downloads(codeUrl, {
dest: codePath,
extract: true,
});
Expand Down

0 comments on commit 5be80ed

Please sign in to comment.