Files
opencommit/src/cli.ts
di-sukharev b8e05a5852 refactor(cli.ts): comment out checkIsLatestVersion function call
chore(checkIsLatestVersion.ts): add import for chalk library
2023-03-21 15:52:32 +08:00

33 lines
905 B
JavaScript
Executable File

#!/usr/bin/env node
import { cli } from 'cleye';
import packageJSON from '../package.json' assert { type: 'json' };
import { configCommand } from './commands/config';
import { hookCommand, isHookCalled } from './commands/githook.js';
import { prepareCommitMessageHook } from './commands/prepare-commit-msg-hook';
import { commit } from './commands/commit';
// import { checkIsLatestVersion } from './utils/checkIsLatestVersion';
const extraArgs = process.argv.slice(2);
cli(
{
version: packageJSON.version,
name: 'opencommit',
commands: [configCommand, hookCommand],
flags: {},
ignoreArgv: (type) => type === 'unknown-flag' || type === 'argument',
help: { description: packageJSON.description }
},
async () => {
// await checkIsLatestVersion();
if (isHookCalled) {
prepareCommitMessageHook();
} else {
commit(extraArgs);
}
},
extraArgs
);