merged with master repo
This commit is contained in:
commit
fcc6760b11
5 changed files with 19 additions and 8 deletions
|
|
@ -183,8 +183,12 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) {
|
|||
var files = fs.readdirSync(sourceDir);
|
||||
|
||||
for(var i = 0; i < files.length; i++) {
|
||||
// ignores all files or directories which match the RegExp in opts.filter
|
||||
if(!opts.whitelist && opts.filter && files[i].match(opts.filter)) continue;
|
||||
// if opts.whitelist is true every file or directory which doesn't match opts.filter will be ignored
|
||||
if(opts.whitelist && opts.filter && !files[i].match(opts.filter)) continue;
|
||||
if (opts.excludeHiddenUnix && /^\./.test(files[i])) continue;
|
||||
|
||||
|
||||
var currFile = fs.lstatSync(sourceDir + "/" + files[i]);
|
||||
|
||||
var fCopyFile = function(srcFile, destFile) {
|
||||
|
|
@ -289,7 +293,7 @@ exports.rmdirRecursive = function rmdirRecursive(dir, clbk){
|
|||
return fs.rmdir(dir, clbk);
|
||||
|
||||
var file = dir+'/'+filename;
|
||||
fs.stat(file, function(err, stat){
|
||||
fs.lstat(file, function(err, stat){
|
||||
if (err) return clbk(err);
|
||||
if (stat.isDirectory())
|
||||
rmdirRecursive(file, rmFile);
|
||||
|
|
@ -384,6 +388,10 @@ exports.LineReader = function(filename, bufferSize) {
|
|||
};
|
||||
|
||||
exports.LineReader.prototype = {
|
||||
close: function() {
|
||||
return fs.closeSync(this.fd);
|
||||
},
|
||||
|
||||
getBufferAndSetCurrentPosition: function(position) {
|
||||
var res = fs.readSync(this.fd, this.bufferSize, position, "ascii");
|
||||
|
||||
|
|
|
|||
Reference in a new issue