feat: update README with installation command and add debug logs in deploy command
- Added installation command for the CLI tool in README. - Enhanced deploy command with debug logging for upload results and query app version. - Integrated useKey for fetching KEVISUAL_TOKEN in get-config module. - Added debug logging in queryAppVersion for better traceability. - Updated temp.md with new dependency and example command for deployment.
This commit is contained in:
@@ -111,6 +111,7 @@ const command = new Command('deploy')
|
||||
}
|
||||
const uploadDirectory = isDirectory ? directory : path.dirname(directory);
|
||||
const res = await uploadFiles(_relativeFiles, uploadDirectory, { key, version, username: org, noCheckAppFiles: !noCheck, directory: options.directory });
|
||||
logger.debug('upload res', res);
|
||||
if (res?.code === 200) {
|
||||
res.data?.upload?.map?.((d) => {
|
||||
console.log(chalk.green('uploaded file', d?.name, d?.path));
|
||||
@@ -119,6 +120,7 @@ const command = new Command('deploy')
|
||||
key: key,
|
||||
version: version,
|
||||
});
|
||||
logger.debug('queryAppVersion res', res2);
|
||||
if (res2.code !== 200) {
|
||||
console.error(chalk.red('查询应用版本失败'), res2.message, key);
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { useKey } from '@kevisual/use-config';
|
||||
|
||||
export const envisionPath = path.join(os.homedir(), '.config', 'envision');
|
||||
const configPath = path.join(os.homedir(), '.config', 'envision', 'config.json');
|
||||
@@ -37,5 +38,8 @@ export const writeConfig = (config: Record<string, any>) => {
|
||||
};
|
||||
|
||||
export const getEnvToken = () => {
|
||||
return process.env.KEVISUAL_TOKEN || '';
|
||||
const envTokne = useKey('KEVISUAL_TOKEN') || '';
|
||||
console.log('getEnvToken', envTokne);
|
||||
// return envTokne;
|
||||
return '';
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { logger } from '@/module/logger.ts';
|
||||
import { query } from '@/module/query.ts';
|
||||
import { DataOpts } from '@kevisual/query';
|
||||
|
||||
@@ -26,6 +27,7 @@ export const queryApp = async (params: QueryAppParams, opts?: any) => {
|
||||
};
|
||||
|
||||
export const queryAppVersion = async (params: { key?: string; version?: string; id?: string }, opts?: DataOpts) => {
|
||||
logger.debug('queryAppVersion params', params, query.url);
|
||||
return await query.post(
|
||||
{
|
||||
path: 'app',
|
||||
|
||||
Reference in New Issue
Block a user