Skip to content

Commit

Permalink
only save latest tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Feb 2, 2022
1 parent 6838c6a commit bd7cf16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/handler/do_import.zig
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub fn get(_: void, response: *http.Response, request: http.Request, args: struc
const destdirpath = try std.fs.path.join(alloc, &.{ root.datadirpath, "packages", try u.uuid.toString(alloc), details.id });
try std.fs.cwd().makePath(destdirpath);

const destpath = try std.fs.path.join(alloc, &.{ destdirpath, try std.mem.concat(alloc, u8, &.{ commit, ".tar.gz" }) });
const destpath = try std.fs.path.join(alloc, &.{ destdirpath, try std.mem.concat(alloc, u8, &.{ "latest", ".tar.gz" }) });
try _internal.rename(tarpath, destpath);
try std.fs.cwd().deleteTree(path);
const tarsize = try extras.fileSize(std.fs.cwd(), destpath);
Expand Down
2 changes: 1 addition & 1 deletion src/handler/hook.zig
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub fn post(_: void, response: *http.Response, request: http.Request, args: stru
const destdirpath = try std.fs.path.join(alloc, &.{ root.datadirpath, "packages", try u.uuid.toString(alloc), details.id });
try std.fs.cwd().makePath(destdirpath);

const destpath = try std.fs.path.join(alloc, &.{ destdirpath, try std.mem.concat(alloc, u8, &.{ commit, ".tar.gz" }) });
const destpath = try std.fs.path.join(alloc, &.{ destdirpath, try std.mem.concat(alloc, u8, &.{ "latest", ".tar.gz" }) });
try _internal.rename(tarpath, destpath);
try std.fs.cwd().deleteTree(path);
const tarsize = try extras.fileSize(std.fs.cwd(), destpath);
Expand Down

0 comments on commit bd7cf16

Please sign in to comment.