Merge pull request #630 from resin-io/629-fix-resin-preload-when-a-commit-is-provided

Fix resin preload when a commit is provided.
This commit is contained in:
Alexis Svinartchouk 2017-08-18 09:38:40 +02:00 committed by GitHub
commit 435fedfa07
2 changed files with 4 additions and 2 deletions

View File

@ -188,7 +188,9 @@ module.exports = {
}
return Promise["try"](function() {
if (options.commit) {
if (_.map(builds, 'commit_hash').indexOf(options.commit) === -1) {
if (!_.find(application.build, {
commit_hash: options.commit
})) {
expectedError('There is no build matching this commit');
}
return options.commit;

View File

@ -196,7 +196,7 @@ module.exports =
# Use the commit given as --commit or show an interactive commit selection menu
Promise.try ->
if options.commit
if _.map(builds, 'commit_hash').indexOf(options.commit) == -1
if not _.find(application.build, commit_hash: options.commit)
expectedError('There is no build matching this commit')
return options.commit
selectApplicationCommit(expectedError, resin, form, application.build)