summaryrefslogtreecommitdiffstats
path: root/roles/prerec/templates/get-file-prefix
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2025-01-23 08:58:18 -0500
committerSacha Chua <sacha@sachachua.com>2025-01-23 08:58:18 -0500
commit745bba1474efe9161468d44bf959f4e830e3dce9 (patch)
tree5374c8f3694bdaa36607136a8935856e95426108 /roles/prerec/templates/get-file-prefix
parent964f44e68a0eba8dd49ab354c3739313f75914be (diff)
downloademacsconf-ansible-745bba1474efe9161468d44bf959f4e830e3dce9.tar.xz
emacsconf-ansible-745bba1474efe9161468d44bf959f4e830e3dce9.zip
convenience scripts
Diffstat (limited to '')
-rwxr-xr-xroles/prerec/templates/get-file-prefix10
1 files changed, 10 insertions, 0 deletions
diff --git a/roles/prerec/templates/get-file-prefix b/roles/prerec/templates/get-file-prefix
new file mode 100755
index 0000000..0240b99
--- /dev/null
+++ b/roles/prerec/templates/get-file-prefix
@@ -0,0 +1,10 @@
+#!/bin/bash
+# {{ ansible_managed }}
+# Usage: get-file-prefix $slug [talks.json]
+# You can also set the TALKS_JSON environment variable
+
+SLUG=$1
+if [ -z "$TALKS_JSON" ]; then
+ TALKS_JSON=${2:-~orga/current/talks.json}
+fi
+jq -r '.talks[] | select(.slug=="'$SLUG'")["file-prefix"]' < $TALKS_JSON