From 08cfaf49b182b7b4f2766061c676f3b89fb88e2e Mon Sep 17 00:00:00 2001 From: hobbes7878 Date: Thu, 21 Nov 2024 14:41:28 +0000 Subject: [PATCH] prettify --- bin/newComponent/index.cjs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/bin/newComponent/index.cjs b/bin/newComponent/index.cjs index 4cbe1146..80b7647d 100644 --- a/bin/newComponent/index.cjs +++ b/bin/newComponent/index.cjs @@ -10,16 +10,19 @@ const LIB = path.join(ROOT, 'src/components'); const TEMPLATE = path.join(__dirname, 'template'); const makeNewComponent = async () => { - const { name, folder } = await prompts([{ - type: 'text', - name: 'name', - message: 'What should we call your new component, e.g., ImagePack?', - }, { - type: 'text', - name: 'folder', - message: 'What folder should we put it in, e.g., Graphics?', - initial: 'Graphics', - }]); + const { name, folder } = await prompts([ + { + type: 'text', + name: 'name', + message: 'What should we call your new component, e.g., ImagePack?', + }, + { + type: 'text', + name: 'folder', + message: 'What folder should we put it in, e.g., Graphics?', + initial: 'Graphics', + }, + ]); if (!name || !folder) return; @@ -43,7 +46,7 @@ const makeNewComponent = async () => { LIB, file.replace(/YourComponent/g, componentName) ); - + fs.ensureDirSync(path.dirname(writePath)); if (path.extname(file) === '.jpg') {