forked from commitizen/cz-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-cz.js
More file actions
27 lines (22 loc) · 781 Bytes
/
git-cz.js
File metadata and controls
27 lines (22 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { configLoader } from '../commitizen';
import { git as useGitStrategy, gitCz as useGitCzStrategy } from './strategies';
export {
bootstrap
};
/**
* This is the main cli entry point.
* environment may be used for debugging.
*/
function bootstrap (environment = {}, argv = process.argv) {
// Get cli args
let rawGitArgs = argv.slice(2, argv.length);
let adapterConfig = environment.config || configLoader.load();
// Choose a strategy based on the existance the adapter config
if (typeof adapterConfig !== 'undefined') {
// This tells commitizen we're in business
useGitCzStrategy(rawGitArgs, environment, adapterConfig);
} else {
// This tells commitizen that it is not needed, just use git
useGitStrategy(rawGitArgs, environment);
}
}