-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: option '--collaborate' | feat: creating handler-options.ts
- Loading branch information
xxxAlvaDevxxx
committed
Apr 29, 2024
1 parent
5696158
commit c764e9b
Showing
5 changed files
with
25 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |