Browse Source

Merge pull request #42 from zeit/fix/path-handling-on-windows

Fix path handling for windows
master
Guillermo Rauch 9 years ago
parent
commit
531fed6b76
  1. 8
      lib/index.js

8
lib/index.js

@ -224,10 +224,10 @@ export default class Now extends EventEmitter {
}
function toRelative (path, base) {
const fullBase = base.endsWith(SEP) ? base + SEP : base;
const relative = path.substr(fullBase.length);
if (relative.startsWith(SEP)) return relative.substr(1);
return relative;
const fullBase = base.endsWith(SEP) ? base : base + SEP;
let relative = path.substr(fullBase.length);
if (relative.startsWith(SEP)) relative = relative.substr(1);
return relative.replace(/\\/g, '/');
}
function responseError (res) {

Loading…
Cancel
Save