summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben@demerara.io>2022-01-19 22:14:23 +0000
committerBen Brown <ben@demerara.io>2022-01-19 22:24:22 +0000
commite49356d5a13f58dbaeefa8608d741d295997282d (patch)
treeb074c9ebd97e50a4bb1bdb60f19f119621115081
parentd5c34b55fca0868442711040adb6e5cda9cde653 (diff)
downloadlorry-e49356d5a13f58dbaeefa8608d741d295997282d.tar.gz
Add support for storing raw files at the repository root
-rw-r--r--README.md6
-rwxr-xr-xlorry.raw-file-importer2
2 files changed, 5 insertions, 3 deletions
diff --git a/README.md b/README.md
index 7659b50..199e8da 100644
--- a/README.md
+++ b/README.md
@@ -289,8 +289,10 @@ will be tagged as 'bkai00mp.ttf')
Lorry can store raw files in a git LFS repository, which may allow your git
server to serve those files via its repository browser.
-For convenience, raw file lorries can specify multiple sources to store in the same repository.
-Each raw file will be stored under a subpath corresponding to the source name.
+For convenience, raw file lorries can specify multiple sources to store in the
+same repository. Each raw file will be stored under a subpath corresponding to
+the source name, specify `.` to store the raw file at the root of the
+repository.
{
"raw-file-repo": {
diff --git a/lorry.raw-file-importer b/lorry.raw-file-importer
index de35e58..968193a 100755
--- a/lorry.raw-file-importer
+++ b/lorry.raw-file-importer
@@ -60,7 +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)
- path = '{}/{}'.format(relative_path, basename)
+ path = os.path.relpath(os.path.join(relative_path, basename))
fromline = 'from {}\n'.format(last_commit) if last_commit else ''