diff options
| -rw-r--r-- | .gitattributes | 16 | ||||
| -rw-r--r-- | validators/bash/validate.sh | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e644653 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,16 @@ +# Ensure consistent line endings (LF) for all text files +* text=auto eol=lf + +# Explicitly mark certain files as text +*.md text +*.json text +*.jsonc text +*.gitinfo text +*.yml text +*.yaml text +*.js text +*.ps1 text +*.sh text eol=lf + +# Shell scripts must always use LF +validators/bash/*.sh text eol=lf diff --git a/validators/bash/validate.sh b/validators/bash/validate.sh index 201c0b7..dddb811 100644 --- a/validators/bash/validate.sh +++ b/validators/bash/validate.sh @@ -63,9 +63,9 @@ validate() { exit 1 fi - # Load schema + # Load schema (also strip carriage returns for Windows compatibility) local schema - if ! schema=$(jq -c . "$SCHEMA_PATH" 2>&1); then + if ! schema=$(tr -d '\r' < "$SCHEMA_PATH" | jq -c . 2>&1); then echo -e "${RED}Error parsing schema: $schema${NC}" >&2 exit 1 fi |
