File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
// Invoked on the commit-msg git hook by yorkie.
2
2
3
- const chalk = require ( 'chalk' )
3
+ import chalk from 'chalk' ;
4
4
const msgPath = process . env . GIT_PARAMS
5
- const msg = require ( 'fs' ) . readFileSync ( msgPath , 'utf-8' ) . trim ( )
5
+ import fs from 'fs' ;
6
+ const msg = fs . readFileSync ( msgPath , 'utf-8' ) . trim ( )
6
7
7
8
const releaseRE = / ^ v \d /
8
9
const commitRE = / ^ ( r e v e r t : ) ? ( f e a t | f i x | s t y l e | d o c s | t y p o | d x | r e f a c t o r | p e r f | t e s t | w o r k f l o w | b u i l d | c i | c h o r e | t y p e s | w i p | r e l e a s e | d e p s ) ( \( .+ \) ) ? : .{ 1 , 50 } /
9
10
10
11
if ( ! releaseRE . test ( msg ) && ! commitRE . test ( msg ) ) {
11
- console . log ( )
12
12
console . error (
13
13
` ${ chalk . bgRed . white ( ' ERROR ' ) } ${ chalk . red (
14
14
`invalid commit message format.`
@@ -21,4 +21,4 @@ if (!releaseRE.test(msg) && !commitRE.test(msg)) {
21
21
chalk . red ( ` See .github/commit-convention.md for more details.\n` )
22
22
)
23
23
process . exit ( 1 )
24
- }
24
+ }
You can’t perform that action at this time.
0 commit comments