only save files that need to be saved

This commit is contained in:
Cassie Tarakajian 2017-12-26 22:23:45 -05:00
parent 754518bf77
commit b2ee44a6c2

View file

@ -35,10 +35,10 @@ Project.count({})
project.files.forEach(async (file, fileIndex) => {
if (file.url && file.url.includes('p5.js-webeditor')) {
file.url = file.url.replace('p5.js-webeditor', process.env.S3_BUCKET);
let savedProject = await project.save();
console.log(`updated file ${file.url}`);
process.exit(0);
}
let savedProject = await project.save();
console.log(`updated file ${file.url}`);
process.exit(0);
});
});
}