Fix resin preload when a commit is provided.

Connects-To 

Change-Type: patch
This commit is contained in:
Alexis Svinartchouk 2017-08-18 09:19:30 +02:00
parent 224dfce4a8
commit 999f269e36
2 changed files with 4 additions and 2 deletions
build/actions
lib/actions

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)