From 863391ce3c75b65c4f84c3c9cbfbe232138c19f2 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 20 Mar 2024 12:17:18 -0500 Subject: [PATCH] feat: add env var for config file path --- src/config.nim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/config.nim b/src/config.nim index 4a02b16..c4984fd 100644 --- a/src/config.nim +++ b/src/config.nim @@ -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