Did a try/catch to deal with the unit tests vs actual project environment, code duplication is needed because of builderEnv

This commit is contained in:
Joe Bowser 2016-10-06 14:45:26 -07:00
parent 7d26c51da6
commit 6418add83d

View File

@ -354,13 +354,24 @@ Api.prototype.run = function(runOptions) {
*/
Api.prototype.clean = function(cleanOptions) {
var self = this;
try {
return require('./lib/check_reqs').run()
.then(function () {
return require('./lib/build').runClean.call(self, cleanOptions);
})
.then(function () {
return require('./lib/prepare').clean.call(self, cleanOptions);
});
.then(function () {
return require('./lib/build').runClean.call(self, cleanOptions);
})
.then(function () {
return require('./lib/prepare').clean.call(self, cleanOptions);
});
}
catch (err) {
return require('../../lib/check_reqs').run()
.then(function () {
return require('./lib/build').runClean.call(self, cleanOptions);
})
.then(function () {
return require('./lib/prepare').clean.call(self, cleanOptions);
});
}
};
/**