diff options
author | Freya Murphy <freya@freyacat.org> | 2024-05-21 21:11:19 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-05-21 21:11:19 -0400 |
commit | 8d544d58af232e82c740cfcb271d20965020c133 (patch) | |
tree | b258dacda826fe8ca7d9c703588262a153b9f6d5 /src/web/lang/_bin/transpile.sh | |
parent | fix modals (diff) | |
download | xssbook2-8d544d58af232e82c740cfcb271d20965020c133.tar.gz xssbook2-8d544d58af232e82c740cfcb271d20965020c133.tar.bz2 xssbook2-8d544d58af232e82c740cfcb271d20965020c133.zip |
things
Diffstat (limited to 'src/web/lang/_bin/transpile.sh')
-rwxr-xr-x | src/web/lang/_bin/transpile.sh | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/web/lang/_bin/transpile.sh b/src/web/lang/_bin/transpile.sh deleted file mode 100755 index 36cd226..0000000 --- a/src/web/lang/_bin/transpile.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -lang_part() { - echo "$1" | awk "{split(\$0,a,\" = \"); print a[$2]}" -} -export -f lang_part - -handle_line() { - line="$1" - left=$(lang_part "$line" 1) - right=$(lang_part "$line" 2) - echo "$left" | grep -Ev '_content|_line' > /dev/null - code=$? - if [ $code -eq 0 ]; then - right=$(echo "$right" | uwuify) - fi; - right=${right%;}; - echo "$left = $right;" -} -export -f handle_line - -transpile() { - file="$1" - out="$2" - printf "" > "$out" - printf "<?php /* Copyright (c) 2024 Freya Murphy */\n\n" > "$out"; - grep "\$lang" < "$file" | xargs -n1 -I{} bash -c 'handle_line "$@"' _ {} >> "$out" -} - -transpile "$1" "$2" |