File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "scopes":[
3+ "messages",
4+ "scripts",
5+ "library",
6+ "command"
7+ ]
8+ }
Original file line number Diff line number Diff line change 11'use strict' ;
22const path = require ( 'path' ) ;
33const chalk = require ( 'chalk' ) ;
4+ const fs = require ( 'fs' ) ;
45const {
56 askType,
67 askScope,
@@ -42,8 +43,8 @@ const config = {
4243} ;
4344
4445try {
45- const localConfig = require ( path . join ( process . cwd ( ) , '.gitchangelog' ) ) ;
46- Object . assign ( config , localConfig ) ;
46+ const localConfig = fs . readFileSync ( path . join ( process . cwd ( ) , '.gitchangelog' ) ) . toString ( 'utf8' ) ;
47+ Object . assign ( config , JSON . parse ( localConfig ) ) ;
4748} catch ( error ) { }
4849
4950const commitTemplate = loadTemplate (
@@ -117,7 +118,7 @@ const run = async () => {
117118 executeScripts ( config . afterCommit , scriptsEnvs ) ;
118119 }
119120
120- console . log ( chalk . greenBright . bold ( 'commited ' ) ) ;
121+ console . log ( chalk . greenBright . bold ( 'committed ' ) ) ;
121122
122123} ;
123124
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const askScope = async (scopes = []) => {
1919 name : 'scope' ,
2020 message : 'which commit scope are you doing?' ,
2121 choices : scopes ,
22- default : scopes [ 0 ]
22+ default : scopes [ 0 ] ,
2323 } ) ;
2424 return answer . scope ;
2525 }
You can’t perform that action at this time.
0 commit comments