File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 5
5
6
6
var fs = require ( 'fs' )
7
7
, path = require ( 'path' )
8
+ , fileURLToPath = require ( 'file-uri-to-path' )
8
9
, join = path . join
9
10
, dirname = path . dirname
10
11
, exists = ( ( fs . accessSync && function ( path ) { try { fs . accessSync ( path ) ; } catch ( e ) { return false ; } return true ; } )
@@ -138,6 +139,12 @@ exports.getFileName = function getFileName (calling_file) {
138
139
Error . prepareStackTrace = origPST
139
140
Error . stackTraceLimit = origSTL
140
141
142
+ // handle filename that starts with "file://"
143
+ var fileSchema = "file://" ;
144
+ if ( fileName . indexOf ( fileSchema ) === 0 ) {
145
+ fileName = fileURLToPath ( fileName ) ;
146
+ }
147
+
141
148
return fileName
142
149
}
143
150
Original file line number Diff line number Diff line change 21
21
"url" : " https://github.com/TooTallNate/node-bindings/issues"
22
22
},
23
23
"homepage" : " https://github.com/TooTallNate/node-bindings" ,
24
- "license" : " MIT"
24
+ "license" : " MIT" ,
25
+ "dependencies" : {
26
+ "file-uri-to-path" : " 1.0.0"
27
+ }
25
28
}
You can’t perform that action at this time.
0 commit comments