From e7254223846dbec352628aa9d156e0fe323a4e93 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 27 May 2022 13:27:21 -0500 Subject: New post, asset moving, dir-locals, etc. --- ht.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ht.sh') diff --git a/ht.sh b/ht.sh index 9c3302f..e874e3c 100755 --- a/ht.sh +++ b/ht.sh @@ -27,7 +27,7 @@ htt() { # htt FILES... ht_build_env() { # ht_build_env FILE... print "body() { cat \"$HTBOD\"; }" > "$HTENV" - : > "$HTBOD"; # clear out body + : > "$HTBOD"; # clear while read -r line; do case "$line" in *@@*:*@@*) # "simple" metadata; just a string @@ -38,7 +38,8 @@ ht_build_env() { # ht_build_env FILE... print "$line" | sed 's/.*@@\([^:]*\):: \?\(.*\)@@.*/\1() { \2 ; }/' ;; - esac >> "$HTENV" + esac | + sed '/%s() {.*}/d' >> "$HTENV" # Still print the line to the body (no need to escape or w/e) print "$line" >> "$HTBOD" done @@ -53,7 +54,7 @@ ht_main() { # main TEMPLATE < INPUT exit 1 fi - eval "ht_build_env; . \"$HTENV\"; print \"\$(htt \"\$@\")\";"; + eval "ht_build_env; . \"$HTENV\"; htt \"\$@\";"; } # To keep this POSIX-compliant, we can't use a bashism like -- cgit 1.4.1-21-gabe81