temp
This commit is contained in:
@@ -3,6 +3,8 @@ import path from 'node:path';
|
||||
import { checkFileExists, AssistantConfig, AssistantConfigData, parseHomeArg, parseHelpArg } from '@/module/assistant/index.ts';
|
||||
import { chalk } from '@/module/chalk.ts';
|
||||
import { HttpsPem } from '@/module/assistant/https/sign.ts';
|
||||
import { Query } from '@kevisual/query/query';
|
||||
|
||||
export { parseHomeArg, parseHelpArg };
|
||||
export type AssistantInitOptions = {
|
||||
path?: string;
|
||||
@@ -13,6 +15,7 @@ export type AssistantInitOptions = {
|
||||
* @class AssistantInit
|
||||
*/
|
||||
export class AssistantInit extends AssistantConfig {
|
||||
#query: Query
|
||||
constructor(opts?: AssistantInitOptions) {
|
||||
const configDir = opts?.path || process.cwd();
|
||||
super({
|
||||
@@ -39,6 +42,17 @@ export class AssistantInit extends AssistantConfig {
|
||||
this.createOtherConfig();
|
||||
this.initPnpm();
|
||||
}
|
||||
get query() {
|
||||
if (!this.#query) {
|
||||
this.setQuery();
|
||||
}
|
||||
return this.#query;
|
||||
}
|
||||
setQuery(query?: Query) {
|
||||
this.#query = query || new Query({
|
||||
url: `${this.getConfig()?.pageApi || 'https://kevisual.cn'}/api/router`,
|
||||
});
|
||||
}
|
||||
checkConfigPath() {
|
||||
const assistantPath = path.join(this.configDir, 'assistant-app', 'assistant-config.json');
|
||||
return checkFileExists(assistantPath);
|
||||
|
||||
Reference in New Issue
Block a user