From 9f354428dd586bff023e1544d8e3fb83ac49e2b0 Mon Sep 17 00:00:00 2001 From: Adam Voss Date: Tue, 13 Jun 2017 15:13:52 -0500 Subject: [PATCH] Add .gitattributes to enforce EOL normalization --- .gitattributes | 3 +++ generators/app/index.js | 2 ++ generators/app/templates/ext-command-js/gitattributes | 3 +++ generators/app/templates/ext-command-ts/gitattributes | 3 +++ test/test.js | 2 +- 5 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 generators/app/templates/ext-command-js/gitattributes create mode 100644 generators/app/templates/ext-command-ts/gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..13bc9c2e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Set default behavior to automatically normalize line endings. +* text=auto + diff --git a/generators/app/index.js b/generators/app/index.js index 768fe57f..43ee8c6f 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -548,6 +548,7 @@ module.exports = yeoman.Base.extend({ this.copy(this.sourceRoot() + '/vscodeignore', context.name + '/.vscodeignore'); this.copy(this.sourceRoot() + '/gitignore', context.name + '/.gitignore'); + this.copy(this.sourceRoot() + '/gitattributes', context.name + '/.gitattributes'); this.template(this.sourceRoot() + '/README.md', context.name + '/README.md', context); this.template(this.sourceRoot() + '/CHANGELOG.md', context.name + '/CHANGELOG.md', context); this.template(this.sourceRoot() + '/vsc-extension-quickstart.md', context.name + '/vsc-extension-quickstart.md', context); @@ -568,6 +569,7 @@ module.exports = yeoman.Base.extend({ this.copy(this.sourceRoot() + '/vscodeignore', context.name + '/.vscodeignore'); this.copy(this.sourceRoot() + '/gitignore', context.name + '/.gitignore'); + this.copy(this.sourceRoot() + '/gitattributes', context.name + '/.gitattributes'); this.template(this.sourceRoot() + '/README.md', context.name + '/README.md', context); this.template(this.sourceRoot() + '/CHANGELOG.md', context.name + '/CHANGELOG.md', context); this.template(this.sourceRoot() + '/vsc-extension-quickstart.md', context.name + '/vsc-extension-quickstart.md', context); diff --git a/generators/app/templates/ext-command-js/gitattributes b/generators/app/templates/ext-command-js/gitattributes new file mode 100644 index 00000000..13bc9c2e --- /dev/null +++ b/generators/app/templates/ext-command-js/gitattributes @@ -0,0 +1,3 @@ +# Set default behavior to automatically normalize line endings. +* text=auto + diff --git a/generators/app/templates/ext-command-ts/gitattributes b/generators/app/templates/ext-command-ts/gitattributes new file mode 100644 index 00000000..13bc9c2e --- /dev/null +++ b/generators/app/templates/ext-command-ts/gitattributes @@ -0,0 +1,3 @@ +# Set default behavior to automatically normalize line endings. +* text=auto + diff --git a/test/test.js b/test/test.js index 5a1c9f57..c71e13f1 100644 --- a/test/test.js +++ b/test/test.js @@ -505,7 +505,7 @@ describe('test code generator', function () { try { - assert.file(['package.json', 'README.md', 'CHANGELOG.md', '.vscodeignore', 'src/extension.ts', 'test/extension.test.ts', 'test/index.ts', '.gitignore', 'tsconfig.json']); + assert.file(['package.json', 'README.md', 'CHANGELOG.md', '.vscodeignore', 'src/extension.ts', 'test/extension.test.ts', 'test/index.ts', '.gitignore', '.gitattributes', 'tsconfig.json']); var body = fs.readFileSync('package.json', 'utf8');