]> Lady’s Gitweb - GitWikiWeb/commitdiff
Allow specifying the revision to pull files from 0.2.0
authorLady <redacted>
Fri, 28 Jul 2023 09:36:30 +0000 (02:36 -0700)
committerLady <redacted>
Fri, 28 Jul 2023 09:36:30 +0000 (02:36 -0700)
build.js

index e8b700344c66acd85b81731b1f9324d68bdd3954..bd8ff27ba2c0fe3743ba4132236fd65237c8cfbc 100644 (file)
--- a/build.js
+++ b/build.js
@@ -20,7 +20,7 @@
 //     export GITWIKIWEB=/srv/git/GitWikiWeb
 //     git archive --remote=$GITWIKIWEB HEAD build.js \
 //       | tar -xO \
-//       | deno run -A - ~/public/wiki $GITWIKIWEB
+//       | deno run -A - ~/public/wiki $GITWIKIWEB current
 //
 // The directory `~/public/wiki` (or whatever you specify as the first
 // argument to `deno run -A -`) **will be deleted** and a new static
@@ -50,6 +50,7 @@ import domSerializer from "npm:dom-serializer@2.0.0";
 
 const DESTINATION = Deno.args[0] ?? "~/public/wiki";
 const REMOTE = Deno.args[1] ?? "/srv/git/GitWikiWeb";
+const REV = Deno.args[2] ?? "HEAD";
 
 const READ_ONLY = {
   configurable: false,
@@ -93,7 +94,7 @@ const getDOM = (source) => {
 
 const getRemoteContent = async (pathName) => {
   const getArchive = new Deno.Command("git", {
-    args: ["archive", `--remote=${REMOTE}`, "HEAD", pathName],
+    args: ["archive", `--remote=${REMOTE}`, REV, pathName],
     stdout: "piped",
     stderr: "piped",
   }).spawn();
@@ -517,7 +518,7 @@ class GitWikiWebPage {
     parseYaml(yaml, { schema: JSON_SCHEMA })
   );
   const ls = new Deno.Command("git", {
-    args: ["ls-tree", "-rz", "live"],
+    args: ["ls-tree", "-rz", "HEAD"],
     stdout: "piped",
     stderr: "piped",
   }).spawn();
This page took 0.021312 seconds and 4 git commands to generate.