chore: some minor changes including formatting

This commit is contained in:
EvolutionX
2022-09-22 11:08:48 +05:30
parent 7a4ef2fe7d
commit bca2a1cb2e
2 changed files with 12 additions and 3 deletions

View File

@@ -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.`
);
}
}

View File

@@ -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);
}
}