Skip to content

Commit

Permalink
Appropriately deal with line endings in scripts (#74)
Browse files Browse the repository at this point in the history
* Appropriately deal with line endings in scripts

* Rename .gitattributes to gitattributes

* Update git.ts
  • Loading branch information
sydist authored Feb 19, 2024
1 parent 357f2f0 commit 724262d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/src/lib/template/git.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import type { ComputedConfiguration, TemplateWriter } from "./template";

import gitattributes from './templates/git/gitattributes?raw';
import gitignore from './templates/git/gitignore?raw';
import workflow from './templates/git/workflow.yml?raw';
import license from './templates/git/LICENSE?raw';

export async function addGitFiles(writer: TemplateWriter, _config: ComputedConfiguration) {
await writer.write('.gitattributes', gitattributes);
await writer.write('.gitignore', gitignore);
await writer.write('.github/workflows/build.yml', workflow);
await writer.write('LICENSE', license);
}
}
9 changes: 9 additions & 0 deletions scripts/src/lib/template/templates/git/gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

0 comments on commit 724262d

Please sign in to comment.