diff options
author | Ben Brown <ben@demerara.io> | 2022-01-19 22:11:26 +0000 |
---|---|---|
committer | Ben Brown <ben@demerara.io> | 2022-01-19 22:11:28 +0000 |
commit | d5c34b55fca0868442711040adb6e5cda9cde653 (patch) | |
tree | 2e70c46af431719326f4c2c3db6a548e5ca96c9e /lorry.raw-file-importer | |
parent | 6941f6ce82c1f35156f4f688c0ae00378aa898b3 (diff) | |
download | lorry-d5c34b55fca0868442711040adb6e5cda9cde653.tar.gz |
Simplify raw-file-importer argument parsing
We always pass the relative path, drop support for optionally passing
it.
Diffstat (limited to 'lorry.raw-file-importer')
-rwxr-xr-x | lorry.raw-file-importer | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lorry.raw-file-importer b/lorry.raw-file-importer index caaa8c9..de35e58 100755 --- a/lorry.raw-file-importer +++ b/lorry.raw-file-importer @@ -60,10 +60,7 @@ def commit_lfs_file(raw_file, relative_path, last_commit, fast_import): # Commit the data to master commit_time = int(time.time()) basename = os.path.basename(raw_file) - if relative_path: - path = '{}/{}'.format(relative_path, basename) - else: - path = basename + path = '{}/{}'.format(relative_path, basename) fromline = 'from {}\n'.format(last_commit) if last_commit else '' @@ -104,15 +101,12 @@ def get_last_commit(): def main(): - if len(sys.argv) < 2 or len(sys.argv) > 3: - print('usage:', sys.argv[0], '<file>', '[<relative path>]') + if len(sys.argv) != 3: + print('usage:', sys.argv[0], '<file>', '<relative path>') sys.exit(1) raw_file = sys.argv[1] - if len(sys.argv) < 3: - relpath = None - else: - relpath = sys.argv[2] + relpath = sys.argv[2] last_commit = get_last_commit() with subprocess.Popen('git fast-import --quiet', shell=True, |