From 724262dcd3820e6805d6098be80e0c4eb5aeb2da Mon Sep 17 00:00:00 2001 From: sydist <81040138+sydist@users.noreply.github.com> Date: Tue, 20 Feb 2024 00:11:58 +0200 Subject: [PATCH] Appropriately deal with line endings in scripts (#74) * Appropriately deal with line endings in scripts * Rename .gitattributes to gitattributes * Update git.ts --- scripts/src/lib/template/git.ts | 4 +++- scripts/src/lib/template/templates/git/gitattributes | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 scripts/src/lib/template/templates/git/gitattributes diff --git a/scripts/src/lib/template/git.ts b/scripts/src/lib/template/git.ts index 18907e2f..efe920b8 100644 --- a/scripts/src/lib/template/git.ts +++ b/scripts/src/lib/template/git.ts @@ -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); -} \ No newline at end of file +} diff --git a/scripts/src/lib/template/templates/git/gitattributes b/scripts/src/lib/template/templates/git/gitattributes new file mode 100644 index 00000000..097f9f98 --- /dev/null +++ b/scripts/src/lib/template/templates/git/gitattributes @@ -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 +