mirror of
https://github.com/daylinmorgan/tsm.git
synced 2024-12-21 20:50:45 -06:00
feat: add env var for config file path
This commit is contained in:
parent
16522d0b07
commit
863391ce3c
1 changed files with 2 additions and 4 deletions
|
@ -1,8 +1,6 @@
|
|||
import std/[os, sequtils, tables, strutils]
|
||||
import std/[os, tables, strutils]
|
||||
import usu
|
||||
|
||||
import term
|
||||
|
||||
type
|
||||
TsmConfig* = object
|
||||
dirs*: seq[string]
|
||||
|
@ -13,7 +11,7 @@ type
|
|||
|
||||
# TODO: update when the API for usu is complete
|
||||
proc loadConfigFile(): TsmConfig =
|
||||
let configPath = getConfigDir() / "tsm" / "config.usu"
|
||||
let configPath = getEnv("TSM_CONFIG", getConfigDir() / "tsm" / "config.usu")
|
||||
if fileExists configPath:
|
||||
let usuNode = parseUsu(readFile configPath)
|
||||
let topFields = usuNode.fields
|
||||
|
|
Loading…
Reference in a new issue