From bca2a1cb2e310c30cb787bc0774883202f68d5d6 Mon Sep 17 00:00:00 2001 From: EvolutionX Date: Thu, 22 Sep 2022 11:08:48 +0530 Subject: [PATCH] chore: some minor changes including formatting --- src/commands/init.ts | 8 ++++++-- src/utilities/install.ts | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/commands/init.ts b/src/commands/init.ts index 46e99fa..d214e43 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -1,4 +1,4 @@ -import { greenBright, redBright } from 'colorette'; +import { greenBright, redBright, underline } from 'colorette'; import { execa } from 'execa'; import { findUp } from 'find-up'; import ora from 'ora'; @@ -104,7 +104,11 @@ async function git(data: Data) { spin.succeed('Git initialized!'); } catch (error) { spin.fail( - `${redBright('Failed')} to initialize git!\nTry to install it at https://git-scm.com\nSkipping for now.` + `${redBright( + 'Failed' + )} to initialize git!\nTry to install it at ${underline( + 'https://git-scm.com' + )}\nSkipping for now.` ); } } diff --git a/src/utilities/install.ts b/src/utilities/install.ts index ed8e347..f674a6a 100644 --- a/src/utilities/install.ts +++ b/src/utilities/install.ts @@ -36,6 +36,7 @@ export async function installDeps(choice: PackageManagerChoice, name: string) { const result = await execa(choice, ['install'], { cwd: process.cwd() + '/' + name, }).catch(() => null); + if (!result || result?.failed) { spin.fail(`${redBright('Failed')} to install dependencies!`); process.exit(1); @@ -56,7 +57,11 @@ export async function cloneRepo(lang: string, name: string) { copyRecursiveSync(`templates/templates/${lang}`, name); fs.rmSync(`templates/`, { recursive: true, force: true }); } catch (error) { - console.log(`${redBright('✖ Failed')} to clone github templates repo. Install git and try again.`) + console.log( + `${redBright( + '✖ Failed' + )} to clone github templates repo. Install git and try again!` + ); process.exit(1); } }