feat: tailchat docker init 命令增加自定义文件夹支持

feat/uniplus
moonrailgun 2 years ago
parent 964a9465df
commit 9b4b375d08

@ -16,15 +16,16 @@ const initWelcome = `================
)} )}
================`; ================`;
const initCompleted = chalk.green(`================ const initCompleted = (dir: string) =>
, ! chalk.green(`================
, !
tailchat: ${chalk.underline( tailchat: ${chalk.underline(
path.join(process.cwd(), './tailchat') path.join(process.cwd(), dir)
)} )}
: :
- ${chalk.bold('cd tailchat')} ${chalk.gray('# 移动到安装目录')} - ${chalk.bold(`cd ${dir}`)} ${chalk.gray('# 移动到安装目录')}
- ${chalk.bold('tailchat docker update')} ${chalk.gray('# 下载/更新官方镜像')} - ${chalk.bold('tailchat docker update')} ${chalk.gray('# 下载/更新官方镜像')}
- ${chalk.bold('docker compose up')} ${chalk.gray('# 启动服务')} - ${chalk.bold('docker compose up')} ${chalk.gray('# 启动服务')}
================`); ================`);
@ -136,12 +137,12 @@ export const dockerInitCommand: CommandModule = {
spinner.info('正在写入配置文件 ...'); spinner.info('正在写入配置文件 ...');
await Promise.all([ await Promise.all([
fs.writeFile('./tailchat/docker-compose.env', rawEnv), fs.writeFile(path.join(dir, 'docker-compose.env'), rawEnv),
fs.writeFile('./tailchat/docker-compose.yml', rawConfig), fs.writeFile(path.join(dir, 'docker-compose.yml'), rawConfig),
]); ]);
spinner.succeed('配置初始化完毕'); spinner.succeed('配置初始化完毕');
console.log(initCompleted); console.log(initCompleted(dir));
} catch (err) { } catch (err) {
spinner.fail('Tailchat with docker 初始化出现意外'); spinner.fail('Tailchat with docker 初始化出现意外');
console.error(err); console.error(err);

Loading…
Cancel
Save