init for deploy files
This commit is contained in:
37
src/command/ls-token.ts
Normal file
37
src/command/ls-token.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { app, Command } from '@/app.ts';
|
||||
import { getConfig, query, writeConfig } from '@/module/index.ts';
|
||||
import inquirer from 'inquirer';
|
||||
|
||||
const token = new Command('token').description('show token').action(async () => {
|
||||
const config = getConfig();
|
||||
console.log('token', config.token);
|
||||
});
|
||||
|
||||
app.addCommand(token);
|
||||
|
||||
const baseURL = new Command('baseURL').description('show baseURL').action(async () => {
|
||||
const config = getConfig();
|
||||
console.log('baseURL', config.baseURL);
|
||||
});
|
||||
app.addCommand(baseURL);
|
||||
|
||||
const setBaseURL = new Command('setBaseURL').description('set baseURL').action(async () => {
|
||||
const config = getConfig();
|
||||
const answers = await inquirer.prompt([
|
||||
{
|
||||
type: 'input',
|
||||
name: 'baseURL',
|
||||
message: `Enter your baseURL:(current: ${config.baseURL})`,
|
||||
},
|
||||
]);
|
||||
const baseURL = answers.baseURL;
|
||||
writeConfig({ ...config, baseURL });
|
||||
});
|
||||
|
||||
app.addCommand(setBaseURL);
|
||||
|
||||
// const showQueryURL = new Command('showQueryURL').description('show query URL').action(async () => {
|
||||
// console.log("url", query.url);
|
||||
// });
|
||||
|
||||
// app.addCommand(showQueryURL);
|
||||
Reference in New Issue
Block a user