From 5bcb5616363307a7cb7724495451367d0eb1e769 Mon Sep 17 00:00:00 2001 From: SharkSV Date: Thu, 24 Feb 2022 18:43:51 +0200 Subject: [PATCH] Minor tweaks & fixes Added the keep option & fixes some small issues --- Lib/Args.ts | 6 +++--- Lib/index.ts | 8 ++++---- Templates/Static/Src/Ts/Scripts.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Lib/Args.ts b/Lib/Args.ts index 62c6771..8909990 100644 --- a/Lib/Args.ts +++ b/Lib/Args.ts @@ -21,11 +21,11 @@ ${gray('$')} ${green('hyper')} ${cyan('')} ${yellow('[options]')} ${bgCyan(` COMMANDS `)}\n ${cyan('help')} ${dim('Print help info')} ${cyan('init')} ${dim('Initialize a new project')} -${cyan('list')} ${dim('List available templates')} +${cyan('list')} ${dim('List available templates')} ${bgYellow(` OPTIONS `)}\n ${yellow('-k, --keep')} ${dim('Keep terminal output ')} ${gray('(off by Default)')} -${yellow('-y, --skip')} ${dim('Generate without prompt')} +${yellow('-y, --skip')} ${dim('Generate without prompt')} ${yellow('-i, --install')} ${dim('Install dependencies')} ${yellow('-v, --version')} ${dim('Print Cli version')} ${gray('(following semver)')} `; @@ -34,7 +34,7 @@ const Args = meow(helpTxt, { flags: { keep: { type: 'boolean', - default: true, + default: false, alias: 'k', description: 'Keep terminal output' }, diff --git a/Lib/index.ts b/Lib/index.ts index 5be92f2..47ab9b5 100644 --- a/Lib/index.ts +++ b/Lib/index.ts @@ -7,12 +7,15 @@ import listTemplates from './Tasks/List'; import { UpdateNotifier } from 'update-notifier'; (async (): Promise => { + const input: string[] = Args.input; + const flags = Args.flags; + Info({ title: 'Hyper', tagLine: 'by @Shorky', description: 'A Cli to bootstrap new projects', version: '3.0', - clear: true + clear: flags.keep ? false : true }); const pkg = { @@ -25,9 +28,6 @@ import { UpdateNotifier } from 'update-notifier'; updateCheckInterval: 0 }).notify({ isGlobal: true }); - const input: string[] = Args.input; - const flags = Args.flags; - // Cmds input.includes('help') && Args.showHelp(0); input.includes('list') && listTemplates(); diff --git a/Templates/Static/Src/Ts/Scripts.ts b/Templates/Static/Src/Ts/Scripts.ts index 1ac661f..8bac3be 100644 --- a/Templates/Static/Src/Ts/Scripts.ts +++ b/Templates/Static/Src/Ts/Scripts.ts @@ -1,2 +1,2 @@ -const msg = 'Hello World' -console.log(msg) +const msg = 'Hello World'; +console.log(msg);