mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
some refactoring + made browse-walk draw a dir in sync (fixed unstable ordering)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
08cb529fc3
commit
bebfe3131e
@ -91,6 +91,18 @@ function(path, make){
|
||||
// XXX expose these as config...
|
||||
var fullpath = false
|
||||
|
||||
// sync version of stat...
|
||||
var stat = function(path){
|
||||
return new Promise(function(resolve, reject){
|
||||
try {
|
||||
resolve(fs.statSync(path))
|
||||
} catch(err){
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
var stat = function(path){
|
||||
return new Promise(function(resolve, reject){
|
||||
fs.stat.call(fs, path, function(err, res){
|
||||
@ -98,6 +110,7 @@ function(path, make){
|
||||
})
|
||||
})
|
||||
}
|
||||
*/
|
||||
|
||||
// get the drive list on windows...
|
||||
if(os.type() == 'Windows_NT' && path == '/'){
|
||||
@ -164,7 +177,10 @@ function(path, make){
|
||||
make(fullpath ? path + '../' : '../'))
|
||||
}
|
||||
|
||||
files.map(function(file){
|
||||
// XXX split out the making stage after the stat stage to
|
||||
// be able to sort suff correctly...
|
||||
files
|
||||
.map(function(file){
|
||||
return stat(path +'/'+ file)
|
||||
.catch(function(err){
|
||||
make(fullpath
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user