mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 22:23:07 +00:00
Update OS & config actions to the latest SDK
Fixes #915 Change-Type: patch
This commit is contained in:
parent
5d1d004b72
commit
892adf4c47
@ -279,7 +279,7 @@ exports.generate =
|
||||
normalizeUuidProp(options, 'device')
|
||||
Promise = require('bluebird')
|
||||
writeFileAsync = Promise.promisify(require('fs').writeFile)
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin = require('resin-sdk').fromSharedOptions()
|
||||
form = require('resin-cli-form')
|
||||
deviceConfig = require('resin-device-config')
|
||||
prettyjson = require('prettyjson')
|
||||
|
@ -31,7 +31,7 @@ resolveVersion = (deviceType, version) ->
|
||||
return Promise.resolve(version)
|
||||
|
||||
form = require('resin-cli-form')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin = require('resin-sdk').fromSharedOptions()
|
||||
|
||||
resin.models.os.getSupportedVersions(deviceType)
|
||||
.then ({ versions, recommended }) ->
|
||||
@ -57,7 +57,7 @@ exports.versions =
|
||||
$ resin os versions raspberrypi3
|
||||
'''
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin = require('resin-sdk').fromSharedOptions()
|
||||
|
||||
resin.models.os.getSupportedVersions(params.type)
|
||||
.then ({ versions, recommended }) ->
|
||||
@ -233,7 +233,7 @@ exports.configure =
|
||||
fs = require('fs')
|
||||
Promise = require('bluebird')
|
||||
readFileAsync = Promise.promisify(fs.readFile)
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin = require('resin-sdk').fromSharedOptions()
|
||||
init = require('resin-device-init')
|
||||
helpers = require('../utils/helpers')
|
||||
patterns = require('../utils/patterns')
|
||||
|
@ -74,12 +74,12 @@ export function generateApplicationConfig(
|
||||
}
|
||||
|
||||
export function generateDeviceConfig(
|
||||
device: ResinSdk.Device & { application_name: string },
|
||||
device: ResinSdk.Device & { belongs_to__application: ResinSdk.PineDeferred },
|
||||
deviceApiKey: string | true | null,
|
||||
options: {},
|
||||
) {
|
||||
return resin.models.application
|
||||
.get(device.application_name)
|
||||
.get(device.belongs_to__application.__id)
|
||||
.then(application => {
|
||||
return generateBaseConfig(application, options).tap(config => {
|
||||
// Device API keys are only safe for ResinOS 2.0.3+. We could somehow obtain
|
||||
|
Loading…
Reference in New Issue
Block a user