diff options
Diffstat (limited to 'export.sh')
| -rwxr-xr-x | export.sh | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -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 |
