Skip to content

Commit

Permalink
chore: constant 'progam' renamed to 'huskubc'
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulCatalinas committed May 7, 2024
1 parent aa5f419 commit a871906
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/config/cli.ts
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
8 changes: 4 additions & 4 deletions src/config/options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Constants
import { program } from '@/constants/huskybc'
import { huskybc } from '@/constants/huskybc'

// Controllers
import {
Expand All @@ -8,7 +8,7 @@ import {
} from '@/controllers/handlers-options'

export function configureOptions() {
program
huskybc
.option(
'-co, --collaborate',
'Open GitHub repository for collaboration',
Expand All @@ -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()
}
}
4 changes: 2 additions & 2 deletions src/constants/huskybc.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { createCommand } from 'commander'
import { Command } from 'commander'

export const program = createCommand('HuskyBC')
export const huskybc = new Command('HuskyBC')
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit a871906

Please sign in to comment.