From bddbb0a78c7f5e93d82f3abd4af36052f49bd35b Mon Sep 17 00:00:00 2001 From: Vijay Pratap Date: Sun, 8 Sep 2024 14:10:56 +0530 Subject: [PATCH] Y2024 --- src/packages/create-mernjs-app/lib/init.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/packages/create-mernjs-app/lib/init.js b/src/packages/create-mernjs-app/lib/init.js index 4c64bd5f..9a02b437 100644 --- a/src/packages/create-mernjs-app/lib/init.js +++ b/src/packages/create-mernjs-app/lib/init.js @@ -8,12 +8,19 @@ const Helpers = require('./utils/Helpers') module.exports = async (projectname, { project_type, template }) => { const currentWorkingDir = process.cwd() let templates = "" - if (template === 'library') { - templates = 'library' - } else if (template === 'snippets') { - templates = 'snippets' - } else { - templates = 'app' + switch (template) { + case "library": + templates = "library" + break; + case "package": + templates = "package" + break; + case "snippets": + templates = "snippets" + break; + default: + templates = 'app' + break; } console.log(' ') console.log(chalk.hex('#4c84ff')(`Creating a new ${chalk.yellow(projectname)} project in`), chalk.green(`${currentWorkingDir}/${projectname}`))