mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-03-11 06:53:56 +00:00
Document resin/config
This commit is contained in:
parent
df12d5108d
commit
0c5126f0d5
@ -1,8 +1,23 @@
|
|||||||
fs = require('fs')
|
fs = require('fs')
|
||||||
errors = require('../errors/errors')
|
errors = require('../errors/errors')
|
||||||
|
|
||||||
|
# Read JSON configuration file
|
||||||
|
#
|
||||||
|
# @private
|
||||||
|
#
|
||||||
# User config loading should be sync, as we need to
|
# User config loading should be sync, as we need to
|
||||||
# extend this module with the result before exporting
|
# extend this module with the result before exporting
|
||||||
|
#
|
||||||
|
# @param {String} configFile configuration file path
|
||||||
|
# @return {Object} Parsed configuration file
|
||||||
|
#
|
||||||
|
# @throw {InvalidConfigFile} Will throw an error if file doesn't exist
|
||||||
|
# @throw {InvalidConfigFile} Will throw an error if file is not JSON
|
||||||
|
#
|
||||||
|
# @example Read config file
|
||||||
|
# contents = resin.config.loadUserConfig('/Users/me/resin-custom.json')
|
||||||
|
# console.log(contents.remoteUrl)
|
||||||
|
#
|
||||||
exports.loadUserConfig = (configFile) ->
|
exports.loadUserConfig = (configFile) ->
|
||||||
return if not fs.existsSync(configFile)
|
return if not fs.existsSync(configFile)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user