Merge branch 'master' of github.com:ryanmcgrath/wrench-js

This commit is contained in:
Ryan McGrath 2012-02-23 05:28:21 -05:00
commit c1ff60f268

View file

@ -175,7 +175,7 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) {
var checkDir = fs.statSync(sourceDir); var checkDir = fs.statSync(sourceDir);
try { try {
fs.mkdirSync(newDirLocation, checkDir.mode); fs.mkdirSync(newDirLocation, checkDir.mode);
} catch (e) { } catch (e) {
//if the directory already exists, that's okay //if the directory already exists, that's okay
if (e.code !== 'EEXIST') throw e; if (e.code !== 'EEXIST') throw e;
} }
@ -368,9 +368,12 @@ exports.LineReader.prototype = {
var res = fs.readSync(this.fd, this.bufferSize, position, "ascii"); var res = fs.readSync(this.fd, this.bufferSize, position, "ascii");
this.buffer += res[0]; this.buffer += res[0];
if(res[1] === 0) return -1; if(res[1] === 0) {
this.currentPosition = -1;
} else {
this.currentPosition = position + res[1];
}
this.currentPosition = position + res[1];
return this.currentPosition; return this.currentPosition;
}, },