Update priority for config path

Previously, the environment variable would take priority over the
command line argument. This is now reversed.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-04 20:41:23 -07:00
parent 997033a4e2
commit d7dd0277ca

View File

@@ -9,7 +9,7 @@ from .config import ServerConfig
from .bot import Bot
parser = argparse.ArgumentParser(description="Run an IRC bot")
parser.add_argument("-c", "--config", type=str, default="config.toml")
parser.add_argument("-c", "--config", type=str, default=None)
parser.add_argument(
"--loglevel",
type=str,
@@ -18,7 +18,7 @@ parser.add_argument(
)
args = parser.parse_args()
config_path = Path(os.environ.get("OMNIBOT_CONFIG", args.config))
config_path = Path(args.config or os.environ.get("OMNIBOT_CONFIG", "config.toml"))
config = ServerConfig()
try: