mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
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:
parent
7d26c51da6
commit
6418add83d
23
bin/templates/cordova/Api.js
vendored
23
bin/templates/cordova/Api.js
vendored
@ -354,13 +354,24 @@ Api.prototype.run = function(runOptions) {
|
|||||||
*/
|
*/
|
||||||
Api.prototype.clean = function(cleanOptions) {
|
Api.prototype.clean = function(cleanOptions) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
try {
|
||||||
return require('./lib/check_reqs').run()
|
return require('./lib/check_reqs').run()
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return require('./lib/build').runClean.call(self, cleanOptions);
|
return require('./lib/build').runClean.call(self, cleanOptions);
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return require('./lib/prepare').clean.call(self, cleanOptions);
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user