From ba27fd58baadc7c83276b5bf9af19c65744fff25 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 3 Jul 2023 21:13:11 -0700 Subject: timers + recipe --- export.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'export.sh') diff --git a/export.sh b/export.sh index 085ea64..95f5f97 100755 --- a/export.sh +++ b/export.sh @@ -1,10 +1,20 @@ #!/usr/bin/env bash shopt -s nullglob -for i in *.org; do - name="${i%%.*}" - echo $name - emacs "$i" --batch -f org-html-export-to-html --kill - tail -n +4 "$name.html" | tee "$name.php" - rm "$name.html" "$name.html~" -done + +export_org_php_monstrosity() { + name="${1%%.*}" + echo $name + emacs "$1" --batch -f org-html-export-to-html --kill + tail -n +4 "$name.html" | tee "$name.php" + rm "$name.html" "$name.html~" +} + +if [ -z "$1" ]; then + for i in *.org; do + export_org_php_monstrosity $i + done + exit +fi + +export_org_php_monstrosity $1 -- cgit v1.3