diff options
-rw-r--r-- | src/pyssg/pyssg.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pyssg/pyssg.py b/src/pyssg/pyssg.py index f579aba..3c75e3c 100644 --- a/src/pyssg/pyssg.py +++ b/src/pyssg/pyssg.py @@ -27,6 +27,7 @@ def get_options() -> Namespace: default='$XDG_CONFIG_HOME/pyssg/pyssgrc', type=str, help='''config file (path) to read from; defaults to + 'pyssgrc' first, then '$XDG_CONFIG_HOME/pyssg/pyssgrc' ''') parser.add_argument('-s', '--src', default='src', @@ -99,7 +100,13 @@ def main() -> None: conf_path: str = opts['config'] conf_path = os.path.expandvars(conf_path) - config: Configuration = Configuration(conf_path) + + config: Configuration = None + if os.path.exists('pyssgrc'): + config = Configuration('pyssgrc') + else: + config = Configuration(conf_path) + config.read() config.fill_missing(opts) |