diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-02-05 16:12:26 +0000 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-02-05 16:12:26 +0000 |
| commit | 9c5c61c43de48492dbf736ebf2da6b164147602b (patch) | |
| tree | 16d0567fc16cedae36569ac1cab026c84f015bf0 /validators/bash | |
| parent | f08c9d730ec054fd8f33c6e04ec728ef8ef2e352 (diff) | |
| download | gitinfo-9c5c61c43de48492dbf736ebf2da6b164147602b.tar gitinfo-9c5c61c43de48492dbf736ebf2da6b164147602b.tar.gz gitinfo-9c5c61c43de48492dbf736ebf2da6b164147602b.tar.bz2 gitinfo-9c5c61c43de48492dbf736ebf2da6b164147602b.tar.xz gitinfo-9c5c61c43de48492dbf736ebf2da6b164147602b.zip | |
use POSIX-compatible sed syntax for Alpine
Diffstat (limited to 'validators/bash')
| -rw-r--r-- | validators/bash/validate.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/validators/bash/validate.sh b/validators/bash/validate.sh index a34c555..82b4af2 100644 --- a/validators/bash/validate.sh +++ b/validators/bash/validate.sh @@ -27,7 +27,8 @@ fi strip_comments() { # Remove carriage returns (Windows line endings), single-line comments, and multi-line comments # Also remove trailing commas before } or ] (valid in JSONC, invalid in JSON) - cat "$1" | tr -d '\r' | sed -e 's|//.*$||g' -e ':a;s|/\*.*\*/||g;ta' -e '/\/\*/,/\*\//d' | sed -e 's/,\s*}/}/g' -e 's/,\s*]/]/g' + # Uses POSIX-compatible sed syntax for portability (works with busybox sed) + cat "$1" | tr -d '\r' | sed 's|//.*$||g' | sed 's|/\*[^*]*\*/||g' | sed 's/,[ ]*}/}/g' | sed 's/,[ ]*]/]/g' } # Validate URI format |
