From 0ad902d4269f07451dafd1bfec1de6be5c5c3f92 Mon Sep 17 00:00:00 2001 From: maiieul Date: Sat, 25 May 2024 00:23:29 +0200 Subject: [PATCH] fix(cli): add try/catch block to create config file --- packages/cli/bin/index.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/cli/bin/index.ts b/packages/cli/bin/index.ts index a1d8a21c1..191c99858 100644 --- a/packages/cli/bin/index.ts +++ b/packages/cli/bin/index.ts @@ -193,16 +193,20 @@ async function handleInit() { }); // CREATE CONFIG FILE - execSync( - `${ - getPackageManagerCommand().exec - } nx g qwik-ui:init --interactive false --project-root=${ - config.projectRoot - } --ui-components-path=${config.uiComponentsPath}`, - { - stdio: 'inherit', - }, - ); + try { + execSync( + `${ + getPackageManagerCommand().exec + } nx g qwik-ui:init --interactive false --project-root=${ + config.projectRoot + } --ui-components-path=${config.uiComponentsPath}`, + { + stdio: 'inherit', + }, + ); + } catch (e) { + console.log('Error creating config file: ', e); + } let shouldCustomize = false; if (!config.style && !config.primaryColor && !config.borderRadius) {