mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-05-12 13:52:56 +00:00
Keep method of loading JSON files consistent
This commit is contained in:
parent
7b483e983d
commit
d06b5117f0
@ -11,7 +11,7 @@ request = Promise.promisify require 'request'
|
|||||||
|
|
||||||
module.exports = ->
|
module.exports = ->
|
||||||
# Load config file
|
# Load config file
|
||||||
userConfig = fs.readFileAsync('/boot/config.json', 'utf8').then(JSON.parse)
|
userConfig = require('/boot/config.json')
|
||||||
|
|
||||||
version = utils.getSupervisorVersion()
|
version = utils.getSupervisorVersion()
|
||||||
|
|
||||||
@ -37,8 +37,8 @@ module.exports = ->
|
|||||||
division: ''
|
division: ''
|
||||||
)
|
)
|
||||||
|
|
||||||
Promise.all([userConfig, keys, version])
|
Promise.all([keys, version])
|
||||||
.then ([userConfig, keys, version]) ->
|
.then ([keys, version]) ->
|
||||||
console.log('UUID:', uuid)
|
console.log('UUID:', uuid)
|
||||||
console.log('User ID:', userConfig.userId)
|
console.log('User ID:', userConfig.userId)
|
||||||
console.log('User:', userConfig.username)
|
console.log('User:', userConfig.username)
|
||||||
@ -74,8 +74,6 @@ module.exports = ->
|
|||||||
Promise.all([
|
Promise.all([
|
||||||
knex('config').truncate()
|
knex('config').truncate()
|
||||||
.then ->
|
.then ->
|
||||||
userConfig
|
|
||||||
.then (userConfig) ->
|
|
||||||
knex('config').insert([
|
knex('config').insert([
|
||||||
{ key: 'uuid', value: uuid }
|
{ key: 'uuid', value: uuid }
|
||||||
{ key: 'apiKey', value: userConfig.apiKey }
|
{ key: 'apiKey', value: userConfig.apiKey }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user