From 055da6c24d088cc15d162e319fea84996d2b3db6 Mon Sep 17 00:00:00 2001 From: EvolutionX Date: Wed, 22 Jun 2022 09:16:34 +0530 Subject: [PATCH] refactor: remove prefix question --- src/commands/init.js | 8 +++----- src/prompts/init.js | 8 -------- src/utilities/edits.js | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/commands/init.js b/src/commands/init.js index d5c9b60..38eadb3 100644 --- a/src/commands/init.js +++ b/src/commands/init.js @@ -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); } diff --git a/src/prompts/init.js b/src/prompts/init.js index fedf7fc..0e6cab3 100644 --- a/src/prompts/init.js +++ b/src/prompts/init.js @@ -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', diff --git a/src/utilities/edits.js b/src/utilities/edits.js index 20bbbb9..484cb1f 100644 --- a/src/utilities/edits.js +++ b/src/utilities/edits.js @@ -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); }