commit 38c746a94b80375b29284ef835b6d973be43c0cd
parent c3b3657cfbc88a306a442a35f61c8782d9f58e3f
Author: hhvn <dev@hhvn.uk>
Date: Fri, 25 Nov 2022 17:10:15 +0000
Add scripts for generating stagit repos
Diffstat:
6 files changed, 69 insertions(+), 2 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "gen/stagit"]
+ path = gen/stagit
+ url = git://hhvn.uk/stagit
+[submodule "gen/stagit-gopher"]
+ path = gen/stagit-gopher
+ url = git://hhvn.uk/stagit-gopher
diff --git a/gen/stagit b/gen/stagit
@@ -0,0 +1 @@
+Subproject commit dd7887487122f4f6bf0bc51360a15919d4033add
diff --git a/gen/stagit-create.rc b/gen/stagit-create.rc
@@ -0,0 +1,30 @@
+#!/bin/rc
+
+me = `$nl{realpath `$nl{dirname $0}}
+path = ($path $me/stagit)
+
+repos = $me/../git
+web = $me/../www
+
+mkdir -p $web
+
+stagit-index $repos/* > $web ^ '/index.html'
+
+for (d in $repos/*) {
+ base = `{basename $d}
+ repo = `{dirname $d}
+ d = `$nl{realpath $d}
+
+ printf '%s... ' $base
+
+ mkdir -p $web ^ '/' ^ $base
+ @{
+ cd $web ^ '/' ^ $base
+ stagit -c '.cache' -u 'git://hhvn.uk/' ^ $base $d
+
+ ln -sf log.html index.html
+ ln -sf $me/../www/index.css style.css
+ }
+
+ echo 'done'
+}
diff --git a/gen/stagit-gopher b/gen/stagit-gopher
@@ -0,0 +1 @@
+Subproject commit 9455a8de3e80881190c9d183a92930364f19c240
diff --git a/gen/stagit-gopher-create.rc b/gen/stagit-gopher-create.rc
@@ -0,0 +1,31 @@
+#!/bin/rc
+
+d = `$nl{realpath `$nl{dirname $0}}
+
+# Add my dir to $path
+# This script should still be able to
+# run if the binaries aren't installed.
+path = ($path $d/stagit-gopher)
+
+reposdir = $d/../git
+repos = $reposdir/*
+gopherdir = $d/../gopher
+stagitdir = /git/
+destdir = $gopherdir ^ $stagitdir
+
+stagit-gopher-index -b $stagitdir $repos > $destdir/index.gph
+
+# Make repos
+for (repo in $repos) {
+ display = `$nl{basename $repo '.git'}
+ dest = $destdir ^ $display
+
+ printf '%s... ' $display
+ @{
+ mkdir -p $dest
+ cd $dest
+ stagit-gopher -b $stagitdir/$display -l 75 $repo
+ ln -sf log.gph index.gph
+ }
+ printf 'done\n'
+}
diff --git a/www/style.css b/www/style.css
@@ -1 +0,0 @@
-index.css
-\ No newline at end of file