refactor: 抽象github url代理逻辑

feat/uniplus
moonrailgun 2 years ago
parent ee9a01d552
commit 964a9465df

@ -29,10 +29,12 @@ const initCompleted = chalk.green(`================
- ${chalk.bold('docker compose up')} ${chalk.gray('# 启动服务')}
================`);
const envUrl =
'https://ghproxy.com/https://raw.githubusercontent.com/msgbyte/tailchat/master/docker-compose.env';
const configUrl =
'https://ghproxy.com/https://raw.githubusercontent.com/msgbyte/tailchat/master/docker-compose.yml';
const envUrl = withGhProxy(
'https://raw.githubusercontent.com/msgbyte/tailchat/master/docker-compose.env'
);
const configUrl = withGhProxy(
'https://raw.githubusercontent.com/msgbyte/tailchat/master/docker-compose.yml'
);
export const dockerInitCommand: CommandModule = {
command: 'init',
@ -176,3 +178,10 @@ async function promptConfirm(message: string): Promise<boolean> {
return res;
}
/**
* github访
*/
function withGhProxy(url: string): string {
return `https://ghproxy.com/${url}`;
}

Loading…
Cancel
Save