diff --git a/apps/cli/src/commands/docker/init.ts b/apps/cli/src/commands/docker/init.ts index b69929d0..d50f65d0 100644 --- a/apps/cli/src/commands/docker/init.ts +++ b/apps/cli/src/commands/docker/init.ts @@ -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 { return res; } + +/** + * 增加github资源代理以优化国内访问速度 + */ +function withGhProxy(url: string): string { + return `https://ghproxy.com/${url}`; +}