From a8719062fb713b15497f337ced63dee11ad44567 Mon Sep 17 00:00:00 2001 From: Raul Catalinas <105791463+RaulCatalinas@users.noreply.github.com> Date: Tue, 7 May 2024 12:27:35 +0200 Subject: [PATCH] chore: constant 'progam' renamed to 'huskubc' --- src/config/cli.ts | 4 ++-- src/config/options.ts | 8 ++++---- src/constants/huskybc.ts | 4 ++-- src/index.ts | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/config/cli.ts b/src/config/cli.ts index 7842380..88f970f 100644 --- a/src/config/cli.ts +++ b/src/config/cli.ts @@ -1,8 +1,8 @@ -import { program } from '@/constants/huskybc' +import { huskybc } from '@/constants/huskybc' import { VERSION } from '@/constants/version' export function configureCLI() { - program + huskybc .description('Command line for easy Husky configuration') .version(VERSION) .showHelpAfterError() diff --git a/src/config/options.ts b/src/config/options.ts index ef6a9c3..f534b80 100644 --- a/src/config/options.ts +++ b/src/config/options.ts @@ -1,5 +1,5 @@ // Constants -import { program } from '@/constants/huskybc' +import { huskybc } from '@/constants/huskybc' // Controllers import { @@ -8,7 +8,7 @@ import { } from '@/controllers/handlers-options' export function configureOptions() { - program + huskybc .option( '-co, --collaborate', 'Open GitHub repository for collaboration', @@ -18,10 +18,10 @@ export function configureOptions() { } export function configureDefaultOption() { - const options = program.opts() + const options = huskybc.opts() // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (!options.build && !options.collaborate && !options.b && !options.co) { - program.help() + huskybc.help() } } diff --git a/src/constants/huskybc.ts b/src/constants/huskybc.ts index ce6be84..4b15ef0 100644 --- a/src/constants/huskybc.ts +++ b/src/constants/huskybc.ts @@ -1,3 +1,3 @@ -import { createCommand } from 'commander' +import { Command } from 'commander' -export const program = createCommand('HuskyBC') +export const huskybc = new Command('HuskyBC') diff --git a/src/index.ts b/src/index.ts index 135e410..79826eb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,11 +3,11 @@ import { configureCLI } from './config/cli' import { configureDefaultOption, configureOptions } from './config/options' // Constants -import { program } from './constants/huskybc' +import { huskybc } from './constants/huskybc' configureCLI() configureOptions() -program.parse() +huskybc.parse() configureDefaultOption()