From b1f54cf813aa77677c0eebf82ad58de17715b185 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Mon, 1 Dec 2025 02:24:16 +0800 Subject: [PATCH] update --- src/command/deploy.ts | 14 ++++---------- src/command/publish.ts | 11 ----------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/command/deploy.ts b/src/command/deploy.ts index 620a242..7e92eb0 100644 --- a/src/command/deploy.ts +++ b/src/command/deploy.ts @@ -23,7 +23,7 @@ export const getPackageJson = (opts?: { version?: string; appKey?: string }) => const packageJson = JSON.parse(fs.readFileSync(filePath, 'utf-8')); const basename = packageJson.basename || ''; const version = packageJson.version || ''; - const app = packageJson.app as { key: string }; + const app = packageJson.app; const userAppArry = basename.split('/'); if (userAppArry.length <= 2 && !opts?.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); if (id && showBackend) { console.log('\n'); - // 获取当前应用的key - const pkKey = pkgInfo?.app?.key || pkgInfo?.appKey; - console.log(chalk.blue('服务端应用部署: '), 'envision pack-deploy', id, '-k '); - if (pkKey) { - console.log('\n'); - console.log(chalk.blue('命令推荐: '), 'envision pack-deploy', id, `-k ${pkKey} -f`); - } + console.log(chalk.blue('服务端应用部署: '), 'envision pack-deploy', id); console.log('\n'); } } else { @@ -186,7 +180,7 @@ const uploadFiles = async (files: string[], directory: string, opts: UploadFileO for (const file of files) { const filePath = path.join(directory, file); const hash = getHash(filePath); - if(!hash){ + if (!hash) { console.error('文件', filePath, '不存在'); console.error('请检查文件是否存在'); } @@ -274,7 +268,7 @@ const deployLoadFn = async (id: string, org?: string) => { const baseURL = getBaseURL(); const deployURL = new URL(`/${user}/${key}/`, baseURL); console.log(chalk.blue('deployURL', deployURL.href)); - } catch (error) {} + } catch (error) { } } else { console.error('deploy-load failed', res.message); } diff --git a/src/command/publish.ts b/src/command/publish.ts index b8a8215..8332a3b 100644 --- a/src/command/publish.ts +++ b/src/command/publish.ts @@ -316,17 +316,6 @@ const packDeployCommand = new Command('pack-deploy') .option('-i, --install ', 'install dependencies') .action(async (id, 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); });