update
This commit is contained in:
@@ -23,7 +23,7 @@ export const getPackageJson = (opts?: { version?: string; appKey?: string }) =>
|
|||||||
const packageJson = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
const packageJson = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
||||||
const basename = packageJson.basename || '';
|
const basename = packageJson.basename || '';
|
||||||
const version = packageJson.version || '';
|
const version = packageJson.version || '';
|
||||||
const app = packageJson.app as { key: string };
|
const app = packageJson.app;
|
||||||
const userAppArry = basename.split('/');
|
const userAppArry = basename.split('/');
|
||||||
if (userAppArry.length <= 2 && !opts?.appKey) {
|
if (userAppArry.length <= 2 && !opts?.appKey) {
|
||||||
console.error(chalk.red('basename is error, 请输入正确的路径, packages.json中basename例如 /root/appKey'));
|
console.error(chalk.red('basename is error, 请输入正确的路径, packages.json中basename例如 /root/appKey'));
|
||||||
@@ -154,13 +154,7 @@ const command = new Command('deploy')
|
|||||||
logger.debug('deploy success', res2.data);
|
logger.debug('deploy success', res2.data);
|
||||||
if (id && showBackend) {
|
if (id && showBackend) {
|
||||||
console.log('\n');
|
console.log('\n');
|
||||||
// 获取当前应用的key
|
console.log(chalk.blue('服务端应用部署: '), 'envision pack-deploy', id);
|
||||||
const pkKey = pkgInfo?.app?.key || pkgInfo?.appKey;
|
|
||||||
console.log(chalk.blue('服务端应用部署: '), 'envision pack-deploy', id, '-k <key>');
|
|
||||||
if (pkKey) {
|
|
||||||
console.log('\n');
|
|
||||||
console.log(chalk.blue('命令推荐: '), 'envision pack-deploy', id, `-k ${pkKey} -f`);
|
|
||||||
}
|
|
||||||
console.log('\n');
|
console.log('\n');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -316,17 +316,6 @@ const packDeployCommand = new Command('pack-deploy')
|
|||||||
.option('-i, --install ', 'install dependencies')
|
.option('-i, --install ', 'install dependencies')
|
||||||
.action(async (id, opts) => {
|
.action(async (id, opts) => {
|
||||||
let { force, key, install } = opts || {};
|
let { force, key, install } = opts || {};
|
||||||
if (!key) {
|
|
||||||
const answers = await inquirer.prompt([
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
name: 'key',
|
|
||||||
message: 'Enter your deploy to services fileKey:',
|
|
||||||
when: () => !key, // 当 username 为空时,提示用户输入
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
key = answers.key || key;
|
|
||||||
}
|
|
||||||
const res = await deployLoadFn(id, key, force, install);
|
const res = await deployLoadFn(id, key, force, install);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user