diff --git a/bun.lockb b/bun.lockb index dfa9734..059c297 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/config/options.ts b/src/config/options.ts index 5dd4777..7e93331 100644 --- a/src/config/options.ts +++ b/src/config/options.ts @@ -1,16 +1,16 @@ -// Third-Party libraries -import opener from 'opener' - // Constants -import { REPOSITORY } from '../constants/github' import { program } from '../constants/huskybc' +import { + handlerOptionBuild, + handlerOptionCollaborate +} from '../controllers/handlers-options' export function configureOptions() { - program.option( - '--collaborate', - 'Open GitHub repository for collaboration', - () => { - opener(REPOSITORY) - } - ) + program + .option( + '--collaborate', + 'Open GitHub repository for collaboration', + handlerOptionCollaborate + ) + .option('--build', "Start Husky's configuration", handlerOptionBuild) } diff --git a/src/controllers/handlers-options.ts b/src/controllers/handlers-options.ts new file mode 100644 index 0000000..5f20617 --- /dev/null +++ b/src/controllers/handlers-options.ts @@ -0,0 +1,13 @@ +import opener from 'opener' +import { REPOSITORY } from '../constants/github' + +export const handlerOptionBuild = () => { + console.log("Generating Husky's configuration") + // code... +} + +export const handlerOptionCollaborate = async () => { + console.log('Open GitHub repository for collaboration...') + await Bun.sleep(500) + opener(REPOSITORY) +} diff --git a/src/controllers/husky-config.ts b/src/controllers/husky-config.ts deleted file mode 100644 index 609cead..0000000 --- a/src/controllers/husky-config.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function huskyConfigController() { - console.log("Generating Husky's configuration") -} diff --git a/src/index.ts b/src/index.ts index d048e9e..2002030 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,20 +1,11 @@ -// Config' +// Config import { configureCLI } from './config/cli' import { configureOptions } from './config/options' -// Controllers -import { huskyConfigController } from './controllers/husky-config' - // Constants import { program } from './constants/huskybc' configureCLI() configureOptions() -const thereIsFirstArgument = program.args[0] !== undefined - -if (!thereIsFirstArgument) { - program.action(huskyConfigController) -} - program.parse()