summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-10-23 15:15:54 +0200
committerlassulus <lassulus@lassul.us>2021-10-23 15:15:54 +0200
commit679922a7831176089fe9e3ad62346b0e0bd4dcdd (patch)
treea6ab4cce1956c7c315106f94fd1d4c0b4e686496 /krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh
parent0564414a3184960555a8146f78b36120e6ef0c21 (diff)
Revert "rip Reaktor"
This reverts commit 55b137ba525f075f4619de4676d3e66f782b1a12.
Diffstat (limited to 'krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh')
-rwxr-xr-xkrebs/5pkgs/simple/Reaktor/scripts/random-issue.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh b/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh
new file mode 100755
index 000000000..5c47c6156
--- /dev/null
+++ b/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh
@@ -0,0 +1,20 @@
+#! /bin/sh
+set -eu
+# requires env:
+# $state_dir
+# $origin
+
+# in PATH: git,lentil,coreutils
+subdir=`echo "$1" | tr -dc "[:alnum:]"`
+name=`echo "$origin" | tr -dc "[:alnum:]"`
+track="$state_dir/$name-checkout"
+(if test -e "$track" ;then
+ cd "$track"
+ git fetch origin master
+ git reset --hard origin/master
+else
+ git clone "$origin" "$track"
+fi) >&2
+
+cd "$track"
+lentil "${subdir:-.}" -f csv | sed 1d | shuf | head -1