Last active
May 24, 2019 16:50
-
-
Save selynna/f90a86a4d7b787a80d08367dc59d755f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("Adding images..."); | |
let fileUploadPromises = []; | |
const pizzaDir = `${dataRoot}/pizza`; | |
const pizzaFiles = fs.readdirSync(pizzaDir); | |
pizzaFiles.forEach(file => { | |
fileUploadPromises.push(trainer.createImagesFromData(project.id, fs.readFileSync(`${pizzaDir}/${file}`), { tagIds: [pizzaTag.id] })); | |
}); | |
await Promise.all(fileUploadPromises); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment