Skip to content
Snippets Groups Projects
Commit 6d9d4d43 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

release script: Fix inconsequential bug.

* The prefix separation was meant to speed up the pattern matching
  and eventually ensure substitution only happens once.
parent cf410392
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ errMsg()
typeset cmd=$BASH_COMMAND pfx
typeset -i ofs=0 vpos src_lev=${#BASH_SOURCE[@]}
while [[ "${cmd:$ofs}" =~ \$\{([a-zA-Z_][a-zA-Z_0-9]*)\} ]]; do
pfx=${cmd:ofs}; vpos=${vpos%%\$*}; ofs=$((ofs+${#vpos}))
pfx=${cmd:ofs}; vpos=${pfx%%\$*}; ofs=$((ofs+${#vpos}))
cmd=${cmd/\$\{${BASH_REMATCH[1]}\}/${!BASH_REMATCH[1]}}
done
printf 'error: failed to run command\n%s\nat %s, line %d!\n' "$cmd" \
......
......@@ -43,7 +43,7 @@ errMsg()
typeset cmd=$BASH_COMMAND pfx
typeset -i ofs=0 vpos src_lev=${#BASH_SOURCE[@]}
while [[ "${cmd:$ofs}" =~ \$\{([a-zA-Z_][a-zA-Z_0-9]*)\} ]]; do
pfx=${cmd:ofs}; vpos=${vpos%%\$*}; ofs=$((ofs+${#vpos}))
pfx=${cmd:ofs}; vpos=${pfx%%\$*}; ofs=$((ofs+${#vpos}))
cmd=${cmd/\$\{${BASH_REMATCH[1]}\}/${!BASH_REMATCH[1]}}
done
printf 'error: failed to run command\n%s\nat %s, line %d!\n' "$cmd" \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment