mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-24 04:55:42 +00:00
Fix semver comparison for OS version when determining if the device has deviceApiKey support
The current setup would cause the check to always fail - the consequence is not *that* bad since the provisioning key still gets overwritten, but it's better to delete it if we can. Change-Type: patch Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
parent
c9b42b83b4
commit
8b2138f744
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user