add test and add micro-app deploy
This commit is contained in:
@@ -13,9 +13,10 @@ export const appCommand = new Command('app').description('app 命令').action(()
|
||||
program.addCommand(appCommand);
|
||||
|
||||
const downloadAppCommand = new Command('download')
|
||||
.description('下载 app serve client的包')
|
||||
.description('下载 app serve client的包. \napp download -i root/code-center')
|
||||
.option('-i, --id <id>', '下载 app serve client的包, id 或者user/key')
|
||||
.option('-o, --output <output>', '下载 app serve client的包, 输出路径')
|
||||
.option('-r, --registry <registry>', '下载 app serve client的包, 使用私有源')
|
||||
.action(async (options) => {
|
||||
const id = options.id || '';
|
||||
if (!id) {
|
||||
@@ -31,12 +32,16 @@ const downloadAppCommand = new Command('download')
|
||||
data.id = id;
|
||||
}
|
||||
const res = await queryApp(data);
|
||||
let registry = 'https://kevisual.xiongxiao.me';
|
||||
if (options?.registry) {
|
||||
registry = new URL(options.registry).origin;
|
||||
}
|
||||
if (res.code === 200) {
|
||||
const app = res.data;
|
||||
const result = await installApp(app, {
|
||||
appDir: '',
|
||||
// kevisualUrl: 'https://kevisual.cn',
|
||||
kevisualUrl: 'https://kevisual.xiongxiao.me',
|
||||
kevisualUrl: registry,
|
||||
});
|
||||
if (result.code === 200) {
|
||||
console.log(chalk.green('下载成功', res.data?.user, res.data?.key));
|
||||
@@ -85,4 +90,4 @@ const uninstallAppCommand = new Command('uninstall')
|
||||
});
|
||||
|
||||
appCommand.addCommand(downloadAppCommand);
|
||||
appCommand.addCommand(uninstallAppCommand);
|
||||
appCommand.addCommand(uninstallAppCommand);
|
||||
|
||||
Reference in New Issue
Block a user