Skip to content

Commit b55ec9f

Browse files
committed
add .gitattributes and strip CRLF from schema loading
1 parent a1e1f37 commit b55ec9f

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Ensure consistent line endings (LF) for all text files
2+
* text=auto eol=lf
3+
4+
# Explicitly mark certain files as text
5+
*.md text
6+
*.json text
7+
*.jsonc text
8+
*.gitinfo text
9+
*.yml text
10+
*.yaml text
11+
*.js text
12+
*.ps1 text
13+
*.sh text eol=lf
14+
15+
# Shell scripts must always use LF
16+
validators/bash/*.sh text eol=lf

validators/bash/validate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ validate() {
6363
exit 1
6464
fi
6565

66-
# Load schema
66+
# Load schema (also strip carriage returns for Windows compatibility)
6767
local schema
68-
if ! schema=$(jq -c . "$SCHEMA_PATH" 2>&1); then
68+
if ! schema=$(tr -d '\r' < "$SCHEMA_PATH" | jq -c . 2>&1); then
6969
echo -e "${RED}Error parsing schema: $schema${NC}" >&2
7070
exit 1
7171
fi

0 commit comments

Comments
 (0)