found a bug (fixed) that triggered a bug in fs-extra (pending: https://github.com/jprichardson/node-fs-extra/issues/237)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-04-18 01:52:09 +03:00
parent 0e87a44b3c
commit 4f7156c8a9
2 changed files with 9 additions and 4 deletions

View File

@ -811,7 +811,9 @@ var FileSystemWriterActions = actions.Actions({
path = path || './exported'
// resolve relative paths...
if(/^(\.\.?[\\\/]|[^\\\/])/.test(path)){
if(/^(\.\.?[\\\/]|[^\\\/])/.test(path)
// and skip windows drives...
&& !/^[a-z]:[\\\/]/i.test(path)){
// XXX do we need to normalize???
path = this.location.path +'/'+ path
}
@ -910,9 +912,11 @@ var FileSystemWriterActions = actions.Actions({
var base_dir = this.location.path
// resolve relative paths...
if(/^(\.\.?[\\\/]|[^\\\/])/.test(path)){
if(/^(\.\.?[\\\/]|[^\\\/])/.test(path)
// and skip windows drives...
&& !/^[a-z]:[\\\/]/i.test(path)){
// XXX do we need to normalize???
path = base_dir +'/'+ path
path = this.location.path +'/'+ path
}
var to_dir = path

View File

@ -103,12 +103,13 @@ function listJSON(path, pattern){
var denodeify =
module.denodeify =
function(func){
var that = this
return function(){
// XXX for some reason this does not see args2array...
// XXX and for some reason the error is not reported...
var args = [].slice.call(arguments)
return new Promise(function(resolve, reject){
func.apply(null, args.concat([function(err, res){
func.apply(that, args.concat([function(err, res){
return err ? reject(err) : resolve(res)
}]))
})