fix: feat: stack lock protocol for singleton project stack access (#255)
Replace grep+sed pipeline in get_fns with pure awk — eliminates remaining BusyBox grep/sed cross-platform issues causing ci_fix_reset to be missed from function name extraction on Alpine CI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
81adad21e5
commit
a5d3f238bf
1 changed files with 10 additions and 6 deletions
|
|
@ -19,12 +19,16 @@ FAILED=0
|
||||||
# Uses awk instead of grep -Eo for busybox/Alpine compatibility (#296).
|
# Uses awk instead of grep -Eo for busybox/Alpine compatibility (#296).
|
||||||
get_fns() {
|
get_fns() {
|
||||||
local f="$1"
|
local f="$1"
|
||||||
# BRE mode (no -E). Use [(][)] for literal parens — unambiguous across
|
# Pure-awk implementation: avoids grep/sed cross-platform differences
|
||||||
# GNU grep and BusyBox grep (some BusyBox builds treat bare () as grouping
|
# (BusyBox grep BRE quirks, sed ; separator issues on Alpine).
|
||||||
# even in BRE). BRE one-or-more via [X][X]* instead of +.
|
awk '
|
||||||
grep '^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_][a-zA-Z0-9_]*[[:space:]]*[(][)]' "$f" 2>/dev/null \
|
/^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_][a-zA-Z0-9_]*[[:space:]]*[(][)]/ {
|
||||||
| sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*[(][)].*$//' \
|
line = $0
|
||||||
| sort -u || true
|
gsub(/^[[:space:]]+/, "", line)
|
||||||
|
sub(/[[:space:]]*[(].*/, "", line)
|
||||||
|
print line
|
||||||
|
}
|
||||||
|
' "$f" 2>/dev/null | sort -u || true
|
||||||
}
|
}
|
||||||
|
|
||||||
# Extract call-position identifiers that look like custom function calls:
|
# Extract call-position identifiers that look like custom function calls:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue