mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
refactor: remove prefix question
This commit is contained in:
@@ -5,7 +5,6 @@ import { execa } from 'execa';
|
||||
import { findUp } from 'find-up';
|
||||
import {
|
||||
cmds_dir,
|
||||
default_prefix,
|
||||
lang,
|
||||
main_dir,
|
||||
gitInit,
|
||||
@@ -46,10 +45,9 @@ export async function init(flags, options) {
|
||||
lang: 'typescript',
|
||||
main_dir: 'src',
|
||||
cmds_dir: 'commands',
|
||||
default_prefix: '!',
|
||||
};
|
||||
} else {
|
||||
data = await prompt([name, lang, main_dir, cmds_dir, default_prefix]);
|
||||
data = await prompt([name, lang, main_dir, cmds_dir]);
|
||||
git_init = (await prompt([gitInit])).gitinit;
|
||||
pm = await npm();
|
||||
}
|
||||
@@ -63,7 +61,7 @@ export async function init(flags, options) {
|
||||
};
|
||||
const file = JSON.stringify(config, null, 2);
|
||||
|
||||
if (Object.keys(data).length < 5) process.exit(1);
|
||||
if (Object.keys(data).length < 4) process.exit(1);
|
||||
|
||||
await cloneRepo(data.lang, data.name);
|
||||
|
||||
@@ -93,7 +91,7 @@ export async function init(flags, options) {
|
||||
await editMain(data.name);
|
||||
await editDirs(data.main_dir, data.cmds_dir, data.name, data.lang);
|
||||
|
||||
console.log(`${greenBright('Success, project was initialised!')}`)
|
||||
console.log(`${greenBright('Success, project was initialised!')}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,14 +18,6 @@ export const lang = {
|
||||
],
|
||||
};
|
||||
|
||||
export const default_prefix = {
|
||||
message:
|
||||
'What is the default prefix for your bot? Type "none" if it is completely Application-Command based',
|
||||
name: 'prefix',
|
||||
type: 'text',
|
||||
initial: '!',
|
||||
};
|
||||
|
||||
export const main_dir = {
|
||||
message: 'What is the main directory of your project?',
|
||||
name: 'main_dir',
|
||||
|
||||
@@ -70,6 +70,6 @@ export async function editDirs(
|
||||
regex,
|
||||
`commands: '${newfold}/${cmds_dirName}'`
|
||||
);
|
||||
// TODO(@jacoobes): edit prefix as well in index.ts/js
|
||||
|
||||
return writeFile(index, edit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user