diff options
author | Preston Pan <preston@nullring.xyz> | 2023-02-05 11:59:49 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-02-05 11:59:49 -0800 |
commit | 66df42ef5fee7614171e2ddff4d62e1ac718ce05 (patch) | |
tree | d8c1e303e92a351bf00343b8d23919d4bfa2f9c8 /process_file | |
parent | 8cc4983e38e3a35f6aa71d59ba377e9bce0dfeea (diff) |
updated?
Diffstat (limited to 'process_file')
-rwxr-xr-x | process_file | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/process_file b/process_file index a96f9e8..0aa9ea4 100755 --- a/process_file +++ b/process_file @@ -27,7 +27,7 @@ template_replacement() # Get contents of file then escapes special characters f_contents="$(cat "$r_tname")" replacement_regexp="$(printf '%s' "$f_contents" | gsed -e 's/[\/&]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" - #Finally do the gsed replace to replace the $$INCLUDE line with the contents of the included template file + #Finally do the sed replace to replace the $$INCLUDE line with the contents of the included template file gsed -i "s/$keyword_regexp/$replacement_regexp/g" "$TEMPLATE_BUILD_DIR/$(basename "$1")" # BUG: This shit does not work # Then we do it all again on the same file. template_replacement "$1" @@ -81,8 +81,8 @@ do done # For some reason I can't trim these inside the loop (i tried) so this works. -gsed -i '/\$\$START/d' "$BUILD_DIR/$1" -gsed -i '/\$\$END/d' "$BUILD_DIR/$1" +sed -i '/\$\$START/d' "$BUILD_DIR/$1" +sed -i '/\$\$END/d' "$BUILD_DIR/$1" debug="$(< "$BUILD_DIR/$1" grep "\$\$SCRIPT")" printf "$debug\n" @@ -96,6 +96,6 @@ then keyword_regexp="$(printf '%s' "$line" | gsed -e 's/[]\/$*.^|[]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" replacement_regexp="$(printf '%s' "$output" | gsed -e 's/[\/&]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" - gsed -i "s/$keyword_regexp/$replacement_regexp/g" "$BUILD_DIR/$1" # BUG: doesn't work with openBSD + sed -i "s/$keyword_regexp/$replacement_regexp/g" "$BUILD_DIR/$1" # BUG: doesn't work with openBSD done fi |