add public fix and pnpm init asst
This commit is contained in:
@@ -43,3 +43,11 @@ const deleteCommand = new Command('delete')
|
||||
logger.debug(info);
|
||||
});
|
||||
appManagerCommand.addCommand(deleteCommand);
|
||||
|
||||
const uploadCommand = new Command('upload')
|
||||
.description('上传应用')
|
||||
.option('-i, --id <id>', '应用名称 root/app-name 的格式,如果是后端,会自动解析为 app-name')
|
||||
.option('-t, --type <type>', '应用类型', 'web')
|
||||
.action(async (options) => {
|
||||
//
|
||||
});
|
||||
|
||||
@@ -63,3 +63,27 @@ const removeCommand = new Command('remove')
|
||||
}
|
||||
});
|
||||
program.addCommand(removeCommand);
|
||||
|
||||
const npmCommand = new Command('pnpm')
|
||||
.description('助手pnpm命令')
|
||||
.option('-p --path <path>', '助手路径,默认为执行命令的目录,如果助手路径不存在则创建。')
|
||||
.action((opts) => {
|
||||
if (opts.path && !opts.path.startsWith('/')) {
|
||||
opts.path = path.join(process.cwd(), opts.path);
|
||||
} else if (opts.path) {
|
||||
opts.path = path.resolve(opts.path);
|
||||
}
|
||||
const configDir = AssistantInit.detectConfigDir(opts.path);
|
||||
console.log('configDir', configDir);
|
||||
const assistantInit = new AssistantInit({
|
||||
path: configDir,
|
||||
});
|
||||
const initRes = assistantInit.initPnpm();
|
||||
if (initRes?.create) {
|
||||
console.log(chalk.blue('助手pnpm命令初始化成功,创建了新文件'));
|
||||
} else {
|
||||
console.log(chalk.green('助手pnpm命令初始化成功'));
|
||||
}
|
||||
});
|
||||
|
||||
Init.addCommand(npmCommand);
|
||||
|
||||
Reference in New Issue
Block a user