mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
added check if target files exist on export...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
a43f341968
commit
2045812d92
@ -1929,6 +1929,12 @@ var FileSystemWriterActions = actions.Actions({
|
||||
// XXX use queue for progress reporting...
|
||||
logger && logger.emit('queued', to)
|
||||
|
||||
// destination exists...
|
||||
if(fs.existsSync(to)){
|
||||
logger && logger.emit('skipping', to)
|
||||
|
||||
// copy...
|
||||
} else {
|
||||
// XXX do we queue these or let the OS handle it???
|
||||
// ...needs testing, if node's fs queues the io
|
||||
// internally then we do not need to bother...
|
||||
@ -1936,7 +1942,9 @@ var FileSystemWriterActions = actions.Actions({
|
||||
.then(function(){
|
||||
logger && logger.emit('done', to) })
|
||||
.catch(function(err){
|
||||
logger && logger.emit('error', err) }))
|
||||
logger && logger.emit('error', err)
|
||||
}))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -2098,11 +2106,17 @@ var FileSystemWriterActions = actions.Actions({
|
||||
|
||||
logger && logger.emit('queued', to)
|
||||
|
||||
// destination exists...
|
||||
if(fs.existsSync(to)){
|
||||
logger && logger.emit('skipping', to)
|
||||
|
||||
} else {
|
||||
return copy(from, to)
|
||||
.then(function(){
|
||||
logger && logger.emit('done', to) })
|
||||
.catch(function(err){
|
||||
logger && logger.emit('error', err) })
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user