fixed fs.dirname()
when dirname(path) === path, now it returns '.'
Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -108,7 +108,8 @@ CasperError.prototype = Object.getPrototypeOf(new Error()); | ... | @@ -108,7 +108,8 @@ CasperError.prototype = Object.getPrototypeOf(new Error()); |
108 | } | 108 | } |
109 | if (!fs.hasOwnProperty('dirname')) { | 109 | if (!fs.hasOwnProperty('dirname')) { |
110 | fs.dirname = function dirname(path) { | 110 | fs.dirname = function dirname(path) { |
111 | return path.replace(/\\/g, '/').replace(/\/[^\/]*$/, ''); | 111 | var dir = path.replace(/\\/g, '/').replace(/\/[^\/]*$/, ''); |
112 | return dir === path ? '.' : dir; | ||
112 | }; | 113 | }; |
113 | } | 114 | } |
114 | if (!fs.hasOwnProperty('isWindows')) { | 115 | if (!fs.hasOwnProperty('isWindows')) { | ... | ... |
-
Please register or sign in to post a comment