commit 0cfcc7968f5d3983b8ad32e365a7e5d52b56eff9
parent 338741f03a073f0963d737d05c15e9d472fa467d
Author: Armaan Bhojwani <me@armaanb.net>
Date: Mon, 5 Apr 2021 18:22:12 -0400
stagit: generate tar archive for each repo
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/stagit.c b/src/stagit.c
@@ -387,6 +387,8 @@ writeheader(FILE *fp, const char *title)
if (license)
fprintf(fp, " | <a href=\"%sfile/%s.html\">LICENSE</a>",
relpath, license);
+ fprintf(fp, " | <a href=\"%s%s.tar.gz\">Download</a>",
+ relpath, strippedname);
fputs("</td></tr></table>\n<hr/>\n<div id=\"content\">\n", fp);
}
@@ -1209,6 +1211,12 @@ main(int argc, char *argv[])
submodules = ".gitmodules";
git_object_free(obj);
+ /* Generate tarball */
+ char tarball[255];
+ sprintf(tarball, "tar -zcf %s.tar.gz --ignore-failed-read --exclude='.git' %s",
+ strippedname, repodir);
+ system(tarball);
+
/* log for HEAD */
fp = efopen("log.html", "w");
relpath = "";