aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--validators/bash/validate.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/validators/bash/validate.sh b/validators/bash/validate.sh
index dddb811..f5ed86e 100644
--- a/validators/bash/validate.sh
+++ b/validators/bash/validate.sh
@@ -25,9 +25,11 @@ fi
# Strip JSONC comments using sed
strip_comments() {
- # Remove carriage returns, single-line comments, multi-line comments, and trailing commas
+ # Remove carriage returns, single-line comments (only at start of line),
+ # multi-line comments, and trailing commas
+ # Note: only strips // comments at line start to avoid breaking URLs like https://
tr -d '\r' < "$1" \
- | sed 's|//.*||g' \
+ | sed 's|^[[:space:]]*//.*||g' \
| sed 's|/\*[^*]*\*/||g' \
| sed 's/,[[:space:]]*}/}/g' \
| sed 's/,[[:space:]]*]/]/g'