From: Lady Date: Fri, 28 Jul 2023 09:36:30 +0000 (-0700) Subject: Allow specifying the revision to pull files from X-Git-Tag: 0.2.0^0 X-Git-Url: https://git.ladys.computer/GitWikiWeb/commitdiff_plain/38a7374d66f9a54f621aa192dcbbd573396e007a?ds=inline Allow specifying the revision to pull files from --- diff --git a/build.js b/build.js index e8b7003..bd8ff27 100644 --- 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();