Auto-merge for PR #468 via VersionBot

Fix semver comparison for OS version when determining if the device has deviceApiKey support
This commit is contained in:
resin-io-versionbot[bot] 2017-07-04 19:18:38 +00:00 committed by GitHub
commit 95c78155c9
3 changed files with 7 additions and 3 deletions

View File

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/).
## v5.1.1 - 2017-07-04
* Fix semver comparison for OS version when determining if the device has deviceApiKey support [Pablo Carranza Velez]
## v5.1.0 - 2017-07-01
* Switch to glide for Go dependencies [Pablo Carranza Velez]

View File

@ -1,7 +1,7 @@
{
"name": "resin-supervisor",
"description": "This is resin.io's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as Resin's API informs it to.",
"version": "5.1.0",
"version": "5.1.1",
"license": "Apache-2.0",
"repository": {
"type": "git",

View File

@ -12,7 +12,7 @@ deviceConfig = require './device-config'
TypedError = require 'typed-error'
osRelease = require './lib/os-release'
semver = require 'semver'
semverRegex = require('semver-regex')()
semverRegex = require('semver-regex')
userConfig = {}
@ -169,7 +169,7 @@ bootstrapOrRetry = ->
hasDeviceApiKeySupport = (osVersion) ->
try
!/^Resin OS /.test(osVersion) or semver.gte(semverRegex.test(osVersion), '2.0.2')
!/^Resin OS /.test(osVersion) or semver.gte(semverRegex().exec(osVersion)[0], '2.0.2')
catch err
console.error('Unable to determine if device has deviceApiKey support', err, err.stack)
false