fix crash in example fetch script

This commit is contained in:
Cassie Tarakajian 2018-05-02 12:29:38 -07:00
parent 9daa0a35f8
commit fa2f3fb444

View file

@ -135,8 +135,6 @@ function createProjectsInP5user(projectsInAllCategories) {
}; };
rp(options).then((res) => { rp(options).then((res) => {
const assets = JSON.parse(res);
User.findOne({ username: process.env.EXAMPLE_USERNAME }, (err, user) => { User.findOne({ username: process.env.EXAMPLE_USERNAME }, (err, user) => {
if (err) throw err; if (err) throw err;
@ -231,7 +229,7 @@ function createProjectsInP5user(projectsInAllCategories) {
} }
const assetsInProject = project.sketchContent.match(/assets\/[\w-]+\.[\w]*/g) const assetsInProject = project.sketchContent.match(/assets\/[\w-]+\.[\w]*/g)
|| project.sketchContent.match(/assets\/[\w-]*/g) || []; || project.sketchContent.match(/asset\/[\w-]*/g) || [];
assetsInProject.forEach((assetNamePath, i) => { assetsInProject.forEach((assetNamePath, i) => {
let assetName = assetNamePath.split('assets/')[1]; let assetName = assetNamePath.split('assets/')[1];