Commit 45affec1 45affec1798ebfba5a6c6afb700a1ab7feb003fd by Nicolas Perriault

fixed fs.dirname()

when dirname(path) === path, now it returns '.'
1 parent 1456d23e
...@@ -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')) {
......