File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ function loadPatch(uri, cb) {
5959 var h = http
6060 if ( ~ uri . protocol . indexOf ( 'https' ) ) {
6161 h = https
62+ } else if ( ~ uri . protocol . indexOf ( 'file:' ) ) {
63+ return fs . readFile ( uri . pathname , ( err , data ) => {
64+ if ( err ) return cb ( err ) ;
65+ return cb ( null , data . toString ( 'utf-8' ) ) ;
66+ } ) ;
6267 }
6368 uri . headers = {
6469 'user-agent' : 'core-validate-commit'
Original file line number Diff line number Diff line change @@ -25,3 +25,8 @@ core-validate-commit - Validate the commit message for a particular commit in no
2525 Passing a url to a specific sha on github:
2626
2727 $ core-validate-commit https://api.github.com/repos/nodejs/node/git/commits/9e9d499b8be8ffc6050db25129b042507d7b4b02
28+
29+ Passing a file containing a single commit message:
30+
31+ $ core-validate-commit file:///tmp/commitmsg.txt
32+
You can’t perform that action at this time.
0 commit comments