Skip to content

Commit

Permalink
Scrub folder for JPG and copy them to vendor indexes folder. Makes su…
Browse files Browse the repository at this point in the history
…re the backups are copied over to the 4-vendor folders.
  • Loading branch information
Jacques Altounian committed Sep 14, 2018
1 parent 8e4d4a9 commit 54779ba
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions lib/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ function createVendorPackage(profileName, targets) {
})

fs.readdir(filePath, function(err, items) {
console.log(items);

for (var i=0; i<items.length; i++) {
console.log(items[i]);
}
});
console.log('BACKUPS ' + items)

fs.copy(filePath + '/backup.jpg', dirTrafficAd + '/backup.jpg', err => {
if (err) return console.error(err)
log('to_traffic backup.jpg success')
var item
for (var i = 0; i < items.length; i++) {
item = items[i]
console.log('Backups ' + item)
if (item.indexOf('.jpg') > -1) {
fs.copy(filePath + '/' + item, dirTrafficAd + '/' + item, err => {
if (err) return console.error(err)
log('to_traffic backup success')
})
}
}
})
})
}
Expand Down

0 comments on commit 54779ba

Please sign in to comment.