refactor: remove prefix question

This commit is contained in:
EvolutionX
2022-06-22 09:16:34 +05:30
parent 3bd262739f
commit 055da6c24d
3 changed files with 4 additions and 14 deletions

View File

@@ -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);
}

View File

@@ -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',

View File

@@ -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);
}