diff options
author | Case Duckworth | 2022-09-28 22:40:19 -0500 |
---|---|---|
committer | Case Duckworth | 2022-09-28 22:40:19 -0500 |
commit | 028f59ebf0fc83d200deed86838d578a44c9ae4a (patch) | |
tree | 668d75ec7339e3301d7dbb6915f665c41f3d0692 | |
parent | add clean command (diff) | |
download | vienna-028f59ebf0fc83d200deed86838d578a44c9ae4a.tar.gz vienna-028f59ebf0fc83d200deed86838d578a44c9ae4a.zip |
shellcheck
-rwxr-xr-x | vienna | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vienna b/vienna index 25ba678..8ce8468 100755 --- a/vienna +++ b/vienna | |||
@@ -65,7 +65,7 @@ configure() { | |||
65 | ## Initialize state | 65 | ## Initialize state |
66 | FILE= | 66 | FILE= |
67 | ## Cleanup after we're done | 67 | ## Cleanup after we're done |
68 | trap cleanup INT KILL | 68 | trap cleanup INT QUIT |
69 | } | 69 | } |
70 | 70 | ||
71 | main() { | 71 | main() { |
@@ -124,6 +124,7 @@ publish() { | |||
124 | 124 | ||
125 | shellfix() { # shellfix FILE... | 125 | shellfix() { # shellfix FILE... |
126 | ## Replace ` with \`, $ with \$, and $$ with $ | 126 | ## Replace ` with \`, $ with \$, and $$ with $ |
127 | # shellcheck disable=2016 | ||
127 | sed -E \ | 128 | sed -E \ |
128 | -e 's/`/\\`/g' \ | 129 | -e 's/`/\\`/g' \ |
129 | -e 's/(^|[^\$])\$([^\$]|$)/\1\\$\2/g' \ | 130 | -e 's/(^|[^\$])\$([^\$]|$)/\1\\$\2/g' \ |
@@ -172,7 +173,7 @@ meta() { # meta FIELD [FILE] < INPUT | |||
172 | metafile="$TMPD/${file}.meta" | 173 | metafile="$TMPD/${file}.meta" |
173 | test -f "$metafile" || | 174 | test -f "$metafile" || |
174 | sed '/<!--/n;/-->/q' >"$metafile" | 175 | sed '/<!--/n;/-->/q' >"$metafile" |
175 | sed -n "s/^[ \t]*$1:[ \t]*//p" <"$metafile" | 176 | sed -n "s/^[ \t]*$field:[ \t]*//p" <"$metafile" |
176 | } | 177 | } |
177 | 178 | ||
178 | ## Customizable bits | 179 | ## Customizable bits |