Skip to content

Commit

Permalink
ptig - ensure config has absolute paths
Browse files Browse the repository at this point in the history
Irrespective of how paths are specified, i.e. config file or command
line.
  • Loading branch information
clach04 committed Nov 19, 2023
1 parent 087efa6 commit fb8c652
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions puren_tonbo/tools/ptig.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,11 +777,13 @@ def main(argv=None):
#import pdb ; pdb.set_trace()
config = puren_tonbo.get_config(options.config_file)
if options.note_root:
paths_to_search = [options.note_root]
relative_paths_to_search = [options.note_root]
else:
paths_to_search = args or [config.get('note_root', '.')]
if not paths_to_search:
relative_paths_to_search = args or [config.get('note_root', '.')]
if not relative_paths_to_search:
usage_error('ERROR: Missing search path/directory') # should never happen now, here just-in-case
paths_to_search = [os.path.abspath(x) for x in relative_paths_to_search]
config['note_root'] = paths_to_search # ensure config updated with path(s) override from command line

if options.codec:
note_encoding = options.codec
Expand Down

0 comments on commit fb8c652

Please sign in to comment.