bump: 更新依赖,添加org deploy
This commit is contained in:
@@ -79,7 +79,11 @@ const command = new Command('deploy')
|
||||
const { id, data, ...rest } = res.data || {};
|
||||
if (id && !update) {
|
||||
console.log(chalk.green('id: '), id);
|
||||
console.log(chalk.green(`run to load: envision deploy-load ${id}`));
|
||||
if (!org) {
|
||||
console.log(chalk.green(`run to load: envision deploy-load ${id}`));
|
||||
} else {
|
||||
console.log(chalk.green(`run to load: envision deploy-load ${id} -o ${org}`));
|
||||
}
|
||||
} else if (id && update) {
|
||||
deployLoadFn(id);
|
||||
} else {
|
||||
@@ -153,7 +157,7 @@ const uploadFiles = async (
|
||||
};
|
||||
app.addCommand(command);
|
||||
|
||||
const deployLoadFn = async (id: string) => {
|
||||
const deployLoadFn = async (id: string, org?: string) => {
|
||||
if (!id) {
|
||||
console.error(chalk.red('id is required'));
|
||||
return;
|
||||
@@ -163,6 +167,7 @@ const deployLoadFn = async (id: string) => {
|
||||
key: 'publish',
|
||||
data: {
|
||||
id: id,
|
||||
username: org,
|
||||
},
|
||||
});
|
||||
if (res.code === 200) {
|
||||
@@ -182,8 +187,9 @@ const deployLoadFn = async (id: string) => {
|
||||
const deployLoad = new Command('deploy-load')
|
||||
.description('部署加载')
|
||||
.argument('<id>', 'id')
|
||||
.action(async (id) => {
|
||||
deployLoadFn(id);
|
||||
.option('-o, --org <org>', 'org')
|
||||
.action(async (id, opts) => {
|
||||
deployLoadFn(id, opts?.org);
|
||||
});
|
||||
app.addCommand(deployLoad);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user