function installNextDependency () { if (!dependencyNames || 0 === dependencyNames.length) { return console.log('> Finished.'); } var dependencyName = dependencyNames.pop(), depencyInstallPath = dependencies[dependencyName].split('@')[0]; if (!dependencyName.match(/(^aurelia\-|.*?\/aurelia\-.*?$)/)) { return installNextDependency(); } notifyOnProgress(dependencyName); jspm.install(dependencyName, {summary: true}) .then(function () { notifyOnProgress(dependencyName, true); installNextDependency(); }) .catch(function (error) { jspm.install(dependencyName, depencyInstallPath, {summary: true}) .then(function () { notifyOnProgress(dependencyName, true); installNextDependency(); }) .catch(function (error) { notifyOnProgress(dependencyName, error.toString()); installNextDependency(); }); }); }
.catch(function (error) { jspm.install(dependencyName, depencyInstallPath, {summary: true}) .then(function () { notifyOnProgress(dependencyName, true); installNextDependency(); }) .catch(function (error) { notifyOnProgress(dependencyName, error.toString()); installNextDependency(); }); });