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) {
59
59
var h = http
60
60
if ( ~ uri . protocol . indexOf ( 'https' ) ) {
61
61
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
+ } ) ;
62
67
}
63
68
uri . headers = {
64
69
'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
25
25
Passing a url to a specific sha on github:
26
26
27
27
$ 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