Skip to content

Commit

Permalink
fix(cli): cleanup code and add missing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Feb 8, 2020
1 parent e37133c commit 00304bc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 40 deletions.
3 changes: 3 additions & 0 deletions @commitlint/cli/package.json
Expand Up @@ -36,7 +36,10 @@
},
"license": "MIT",
"devDependencies": {
"@types/execa": "^0.9.0",
"@types/yargs": "^15.0.3",
"@commitlint/test": "8.2.0",
"@commitlint/utils": "^8.3.4",
"execa": "0.11.0",
"fs-extra": "^8.1.0"
},
Expand Down
4 changes: 2 additions & 2 deletions @commitlint/cli/src/cli.test.ts
Expand Up @@ -11,7 +11,7 @@ interface TestOptions {
env?: Record<string, string>;
}

function cli(args: string[], options: TestOptions) {
const cli = (args: string[], options: TestOptions) => {
return (input = '') => {
const c = execa(bin, args, {
cwd: options.cwd,
Expand All @@ -20,7 +20,7 @@ function cli(args: string[], options: TestOptions) {
});
return c.catch(err => err);
};
}
};

const gitBootstrap = (fixture: string) => git.bootstrap(fixture, __dirname);
const fixBootstrap = (fixture: string) => fix.bootstrap(fixture, __dirname);
Expand Down
4 changes: 2 additions & 2 deletions @commitlint/cli/src/cli.ts
Expand Up @@ -103,14 +103,14 @@ const cli = yargs
`[input] reads from stdin if --edit, --env, --from and --to are omitted`
).argv;

main(cli).catch(err =>
main(cli).catch(err => {
setTimeout(() => {
if (err.type === pkg.name) {
process.exit(1);
}
throw err;
}, 0)
);
});

async function main(options: CliFlags) {
const raw = options._;
Expand Down
36 changes: 0 additions & 36 deletions @commitlint/cli/src/help.ts

This file was deleted.

0 comments on commit 00304bc

Please sign in to comment.