Skip to content

Commit

Permalink
Merge pull request #6413 from hieupham007/timob-18097
Browse files Browse the repository at this point in the history
[TIMOB-18097]: Fix CLI crashes
  • Loading branch information
cb1kenobi committed Dec 2, 2014
2 parents fbac3c7 + 11ebc0f commit 2f7c874
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ AndroidBuilder.prototype.validate = function validate(logger, config, cli) {
}
});
}
});
}, this);

// check missing abis
var missingAbis = module.abis.length && this.abis.filter(function (a) { return module.abis.indexOf(a) == -1; });
Expand Down Expand Up @@ -1870,14 +1870,16 @@ AndroidBuilder.prototype.computeHashes = function computeHashes(next) {
this.activitiesHash = this.hash(android && android.application && android.application ? JSON.stringify(android.application.activities) : '');
this.servicesHash = this.hash(android && android.services ? JSON.stringify(android.services) : '');

var self = this;

function walk(dir, re) {
var hashes = [];
fs.existsSync(dir) && fs.readdirSync(dir).forEach(function (name) {
var file = path.join(dir, name);
if (fs.existsSync(file)) {
var stat = fs.statSync(file);
if (stat.isFile() && re.test(name)) {
hashes.push(this.hash(fs.readFileSync(file).toString()));
hashes.push(self.hash(fs.readFileSync(file).toString()));
} else if (stat.isDirectory()) {
hashes = hashes.concat(walk(file, re));
}
Expand Down

0 comments on commit 2f7c874

Please sign in to comment.