Try path relative to git root directory

This commit is contained in:
Edgar Geier 2019-07-22 22:48:58 +02:00
parent 183e205288
commit 69a496339f

View file

@ -42,6 +42,9 @@ def _file_path(path):
elif os.path.exists(path): elif os.path.exists(path):
msg = '{} is not a regular file'.format(path) msg = '{} is not a regular file'.format(path)
raise argparse.ArgumentTypeError(msg) raise argparse.ArgumentTypeError(msg)
git_path = os.path.join(git.get_root(), path)
if os.path.isfile(git_path):
return git_path
else: else:
msg = '{} does not exist'.format(path) msg = '{} does not exist'.format(path)
raise argparse.ArgumentTypeError(msg) raise argparse.ArgumentTypeError(msg)