add pm2
This commit is contained in:
@@ -146,14 +146,27 @@ const setCommand = new Command('set')
|
||||
when: () => value === 'not_input',
|
||||
},
|
||||
]);
|
||||
if (answer.value === 'not_input') {
|
||||
if (value === 'not_input' && !answer.value) {
|
||||
value = '';
|
||||
}
|
||||
value = answer.value || value;
|
||||
if (key === 'workdir') {
|
||||
await setWorkdir({ workdir: value });
|
||||
return;
|
||||
}
|
||||
const transformValue = (value: string) => {
|
||||
if (value === 'true') {
|
||||
return true;
|
||||
}
|
||||
if (value === 'false') {
|
||||
return false;
|
||||
}
|
||||
// 如果是数字
|
||||
if (!isNaN(Number(value))) {
|
||||
return Number(value);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
const newValue = transformValue(value);
|
||||
if (key && value) {
|
||||
flag = true;
|
||||
if (key === 'dev') {
|
||||
@@ -166,9 +179,6 @@ const setCommand = new Command('set')
|
||||
config[key] = value;
|
||||
}
|
||||
console.log(chalk.green(`set ${key} success:`, config.key));
|
||||
} else if (key) {
|
||||
flag = true;
|
||||
delete config[key];
|
||||
}
|
||||
if (flag) {
|
||||
writeConfig(config);
|
||||
|
||||
Reference in New Issue
Block a user