From c6f0b8bfd864cc6e8b45d7db671cc62e95b71113 Mon Sep 17 00:00:00 2001 From: Joe Flateau Date: Tue, 16 Nov 2021 21:38:54 -0500 Subject: [PATCH] fix: lint always fails on windows github runners due to line endings (#92) * fix: lint always fails on windows github runners due to line endings * refactor: use .gitattributes to force line endings so linting passes on windows --- src/index.ts | 13 ++++++++----- templates/basic/gitattributes | 1 + templates/react-with-storybook/gitattributes | 1 + templates/react/gitattributes | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 templates/basic/gitattributes create mode 100644 templates/react-with-storybook/gitattributes create mode 100644 templates/react/gitattributes diff --git a/src/index.ts b/src/index.ts index 8dda74c64..f55c84d00 100755 --- a/src/index.ts +++ b/src/index.ts @@ -168,11 +168,14 @@ prog overwrite: true, } ); - // fix gitignore - await fs.move( - path.resolve(projectPath, './gitignore'), - path.resolve(projectPath, './.gitignore') - ); + // fix dotfiles + const dotfiles = ['gitignore', 'gitattributes']; + for (const dotfile of dotfiles) { + await fs.move( + path.resolve(projectPath, `./${dotfile}`), + path.resolve(projectPath, `./.${dotfile}`) + ); + } // update license year and author let license: string = await fs.readFile( diff --git a/templates/basic/gitattributes b/templates/basic/gitattributes new file mode 100644 index 000000000..fcadb2cf9 --- /dev/null +++ b/templates/basic/gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/templates/react-with-storybook/gitattributes b/templates/react-with-storybook/gitattributes new file mode 100644 index 000000000..fcadb2cf9 --- /dev/null +++ b/templates/react-with-storybook/gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/templates/react/gitattributes b/templates/react/gitattributes new file mode 100644 index 000000000..fcadb2cf9 --- /dev/null +++ b/templates/react/gitattributes @@ -0,0 +1 @@ +* text eol=lf