refactor: 抽象github url代理逻辑

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

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

Loading…
Cancel
Save