mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 14:37:47 +00:00
Document resin/config
This commit is contained in:
parent
df12d5108d
commit
0c5126f0d5
@ -1,8 +1,23 @@
|
||||
fs = require('fs')
|
||||
errors = require('../errors/errors')
|
||||
|
||||
# Read JSON configuration file
|
||||
#
|
||||
# @private
|
||||
#
|
||||
# User config loading should be sync, as we need to
|
||||
# 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) ->
|
||||
return if not fs.existsSync(configFile)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user