mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 20:00:10 +00:00
migrated from the depricated .existsSync(..) to .stat(..)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
66634f3316
commit
5618addf35
@ -70,6 +70,8 @@ function(path, make){
|
|||||||
var fullpath = false
|
var fullpath = false
|
||||||
var showfiles = true
|
var showfiles = true
|
||||||
|
|
||||||
|
var stat = promise.denodeify(fs.stat)
|
||||||
|
|
||||||
// get the drive list on windows...
|
// get the drive list on windows...
|
||||||
if(os.type() == 'Windows_NT' && path == '/'){
|
if(os.type() == 'Windows_NT' && path == '/'){
|
||||||
return new promise(function(resolve, reject){
|
return new promise(function(resolve, reject){
|
||||||
@ -78,18 +80,22 @@ function(path, make){
|
|||||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||||
.split('')
|
.split('')
|
||||||
.forEach(function(drive){
|
.forEach(function(drive){
|
||||||
// XXX error handling???
|
stat(drive+':/')
|
||||||
if(fs.existsSync(drive+':/')){
|
// XXX
|
||||||
make(drive+':/')
|
.catch(function(err){
|
||||||
}
|
})
|
||||||
|
.then(function(data){
|
||||||
|
data && make(drive+':/')
|
||||||
|
|
||||||
|
if(drive == 'Z'){
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
resolve()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// list dirs...
|
// list dirs...
|
||||||
} else {
|
} else {
|
||||||
var stat = promise.denodeify(fs.stat)
|
|
||||||
|
|
||||||
return new promise(function(resolve, reject){
|
return new promise(function(resolve, reject){
|
||||||
fs.readdir(path, function(err, files){
|
fs.readdir(path, function(err, files){
|
||||||
// XXX
|
// XXX
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user