copy file with orginal name if no exif exists

master
Matt Huntington 6 years ago
parent 8e2c6ce31d
commit e81cd005e7

@ -10,6 +10,11 @@ fs.readdir(dir, (err, files) => {
if (error){
// console.log('Error: '+error.message);
// console.log(file);
fs.copyFile(dir+file, '/Users/matthuntington/Downloads/reorg/'+file, fs.constants.COPYFILE_EXCL, (err) => {
if(err){
console.log(err);
}
});
}
else{
if(exifData.exif.CreateDate){
@ -20,6 +25,14 @@ fs.readdir(dir, (err, files) => {
console.log(err);
}
});
} else {
// console.log(exifData);
// console.log(file);
fs.copyFile(dir+file, '/Users/matthuntington/Downloads/reorg/'+file, fs.constants.COPYFILE_EXCL, (err) => {
if(err){
console.log(err);
}
});
}
}
});

Loading…
Cancel
Save