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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user