Skip to content

Commit

Permalink
fixed when -c is a non-existent configuration file path
Browse files Browse the repository at this point in the history
  • Loading branch information
Teingi committed Jun 12, 2024
1 parent d811036 commit f30d63d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ def do_command(self):
config_path = os.path.expanduser('~/.obdiag/config.yml')
custom_config = Util.get_option(self.opts, 'c')
if custom_config:
config_path = custom_config
if os.path.exists(os.path.abspath(custom_config)):
config_path = custom_config
else:
ROOT_IO.error('The option you provided with -c: {0} is a non-existent configuration file path.'.format(custom_config))
return
obdiag = ObdiagHome(stdio=ROOT_IO, config_path=config_path)
obdiag.set_options(self.opts)
obdiag.set_cmds(self.cmds)
Expand Down

0 comments on commit f30d63d

Please sign in to comment.