fix bugs for query -app
This commit is contained in:
@@ -11,6 +11,7 @@ import chalk from 'chalk';
|
||||
import { installDeps } from '@/uitls/npm.ts';
|
||||
import { upload } from '@/module/download/upload.ts';
|
||||
import { getHash } from '@/uitls/hash.ts';
|
||||
import { queryAppVersion } from '@/query/app-manager/query-app.ts';
|
||||
/**
|
||||
* 获取package.json 中的 basename, version, user, appKey
|
||||
* @returns
|
||||
@@ -117,7 +118,15 @@ const command = new Command('deploy')
|
||||
res.data?.upload?.map?.((d) => {
|
||||
console.log(chalk.green('uploaded file', d?.name, d?.path));
|
||||
});
|
||||
const { id, data, ...rest } = res.data?.app || {};
|
||||
const res2 = await queryAppVersion({
|
||||
key: key,
|
||||
version: version,
|
||||
});
|
||||
if (res2.code !== 200) {
|
||||
console.error(chalk.red('查询应用版本失败'), res2.message);
|
||||
return;
|
||||
}
|
||||
const { id, data, ...rest } = res2.data?.app || {};
|
||||
if (id && !update) {
|
||||
console.log(chalk.green('id: '), id);
|
||||
if (!org) {
|
||||
@@ -159,7 +168,6 @@ type UploadFileOptions = {
|
||||
};
|
||||
const uploadFiles = async (files: string[], directory: string, opts: UploadFileOptions): Promise<any> => {
|
||||
const { key, version, username } = opts || {};
|
||||
const config = await getConfig();
|
||||
const form = new FormData();
|
||||
const data: Record<string, any> = { files: [] };
|
||||
for (const file of files) {
|
||||
|
||||
Reference in New Issue
Block a user