From 964a9465df63f6ba89923cb1ab349df58a13e9ce Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Mon, 23 Jan 2023 02:32:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=8A=BD=E8=B1=A1github=20url?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/cli/src/commands/docker/init.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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}`; +}