summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/Reaktor/scripts/random-issue.sh
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-12-26 11:06:11 +0100
committermakefu <github@syntax-fehler.de>2015-12-26 11:06:11 +0100
commit669e4be273ac2abe9505ca6411d5ee37f1771d4c (patch)
tree5278838a595aa13d27b24e6899f6743b31fc011c /krebs/5pkgs/Reaktor/scripts/random-issue.sh
parent8f98ae9842963d801945c850e9da1e450e098ce3 (diff)
k 5 Reaktor/plugins: converted plugins from makefu/2/Reaktor
Diffstat (limited to 'krebs/5pkgs/Reaktor/scripts/random-issue.sh')
-rw-r--r--krebs/5pkgs/Reaktor/scripts/random-issue.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/krebs/5pkgs/Reaktor/scripts/random-issue.sh b/krebs/5pkgs/Reaktor/scripts/random-issue.sh
new file mode 100644
index 000000000..5c47c6156
--- /dev/null
+++ b/krebs/5pkgs/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