Skip to content

Commit

Permalink
Add better warnings for missing looper config files #515
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Aug 23, 2024
1 parent a01722f commit d9ea2ad
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions looper/cli_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,14 @@ def run_looper(args: TopLevelParser, parser: ArgumentParser, test_args=None):
else:
setattr(subcommand_args, looper_config_key, looper_config_item)

except OSError:
parser.print_help(sys.stderr)
_LOGGER.warning(
f"Looper config file does not exist. Use looper init to create one at {looper_cfg_path}."
)
except OSError as e:
if subcommand_args.config:
_LOGGER.warning(
f"\nLooper config file does not exist at given path {subcommand_args.config}. Use looper init to create one at {looper_cfg_path}."
)
else:
_LOGGER.warning(e)

sys.exit(1)

subcommand_args = enrich_args_via_cfg(
Expand Down

0 comments on commit d9ea2ad

Please sign in to comment.