congif from .cell/cell.toml
This commit is contained in:
@@ -232,6 +232,27 @@ globalThis.use = function use(file, ...args) {
|
||||
return ret
|
||||
}
|
||||
|
||||
var configPath = '.cell/cell.toml'
|
||||
if (io.exists(configPath)) {
|
||||
try {
|
||||
var toml = use('toml')
|
||||
var configText = io.slurp(configPath)
|
||||
var config = toml.decode(configText)
|
||||
|
||||
// Override defaults with config values
|
||||
if (config.ENETSERVICE !== undefined) {
|
||||
ENETSERVICE = config.ENETSERVICE
|
||||
log.system(`Loaded ENETSERVICE from config: ${ENETSERVICE}`)
|
||||
}
|
||||
if (config.REPLYTIMEOUT !== undefined) {
|
||||
REPLYTIMEOUT = config.REPLYTIMEOUT
|
||||
log.system(`Loaded REPLYTIMEOUT from config: ${REPLYTIMEOUT}`)
|
||||
}
|
||||
} catch (err) {
|
||||
log.error(`Failed to load config from ${configPath}: ${err}`)
|
||||
}
|
||||
}
|
||||
|
||||
globalThis.json = use('json')
|
||||
var time = use('time')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user