Skip to content

Commit a492760

Browse files
committed
Fix windows compatibily issue
1 parent 49cc061 commit a492760

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set
2+
* text=auto
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout
6+
*.js text eol=lf
7+
*.json text eol=lf
8+
*.md text eol=lf
9+
*.yml text eol=lf
10+
*.yaml text eol=lf
11+
*.txt text eol=lf
12+
13+
# Declare files that will always have CRLF line endings on checkout
14+
*.bat text eol=crlf
15+
16+
# Denote all files that are truly binary and should not be modified
17+
*.png binary
18+
*.jpg binary
19+
*.jpeg binary
20+
*.gif binary
21+
*.ico binary
22+
*.pdf binary

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ jobs:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
2222

23+
- name: Configure Git line endings
24+
run: |
25+
git config --global core.autocrlf false
26+
git config --global core.eol lf
27+
2328
- name: Setup Node.js ${{ matrix.node-version }}
2429
uses: actions/setup-node@v4
2530
with:

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ Thank you for your interest in contributing to create-pull-request! This documen
3232
node create-pull-request.js --help
3333
```
3434

35+
### Windows Compatibility
36+
37+
The project is configured to work correctly on Windows, macOS, and Linux. If you encounter line ending issues on Windows, ensure your Git configuration is set up correctly:
38+
39+
```bash
40+
# Configure Git to handle line endings automatically
41+
git config --global core.autocrlf false
42+
git config --global core.eol lf
43+
```
44+
45+
The project includes:
46+
- **`.gitattributes`** - Ensures consistent line endings across platforms
47+
- **CI configuration** - Automatically handles line endings in GitHub Actions
48+
- **Cross-platform testing** - Tests run on all three major operating systems
49+
3550
## Testing
3651

3752
We use [Vitest](https://vitest.dev/) for testing. The test suite includes:

0 commit comments

Comments
 (0)