Skip to content

Commit a6caef9

Browse files
committed
🚑 Handle undefined() behaviour
Fixes #19 Signed-off-by: Carlos Cuesta <carloscuesta@me.com>
1 parent d0803bc commit a6caef9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cli.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ const commands = {
4848
hook: () => gitmojiCli.ask('hook'),
4949
version: () => console.log(gitmojiCli.version(pkg.version)),
5050
commit: () => gitmojiCli.ask('client'),
51-
undefined: () => gitmojiCli.ask('client')
51+
undefined: () => {
52+
if (process.argv[2]==='--hook') {
53+
gitmojiCli.ask('hook');
54+
} else {
55+
gitmojiCli.ask('client');
56+
}
57+
}
5258
};
5359

5460
const arg = Object.keys(cli.flags)[1];

0 commit comments

Comments
 (0)