From 8d6119f31dc5c65052125ec09cd1ac5bc86cce0d Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Wed, 23 Aug 2017 15:04:04 -0700 Subject: [PATCH] Remove the Yeoman-specific gitignore workaround --- .../Content/aurelia/{template_gitignore => .gitignore} | 0 .../knockout/{template_gitignore => .gitignore} | 0 .../Content/vue/{template_gitignore => .gitignore} | 0 .../Content/angular/{template_gitignore => .gitignore} | 0 .../Content/react/{template_gitignore => .gitignore} | 0 .../Content/redux/{template_gitignore => .gitignore} | 0 templates/package-builder/src/build/build.ts | 10 +++------- 7 files changed, 3 insertions(+), 7 deletions(-) rename templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/{template_gitignore => .gitignore} (100%) rename templates/Microsoft.AspNetCore.SpaTemplates/Content/knockout/{template_gitignore => .gitignore} (100%) rename templates/Microsoft.AspNetCore.SpaTemplates/Content/vue/{template_gitignore => .gitignore} (100%) rename templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/angular/{template_gitignore => .gitignore} (100%) rename templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/{template_gitignore => .gitignore} (100%) rename templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/{template_gitignore => .gitignore} (100%) diff --git a/templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/template_gitignore b/templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/.gitignore similarity index 100% rename from templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/template_gitignore rename to templates/Microsoft.AspNetCore.SpaTemplates/Content/aurelia/.gitignore diff --git a/templates/Microsoft.AspNetCore.SpaTemplates/Content/knockout/template_gitignore b/templates/Microsoft.AspNetCore.SpaTemplates/Content/knockout/.gitignore similarity index 100% rename from templates/Microsoft.AspNetCore.SpaTemplates/Content/knockout/template_gitignore rename to templates/Microsoft.AspNetCore.SpaTemplates/Content/knockout/.gitignore diff --git a/templates/Microsoft.AspNetCore.SpaTemplates/Content/vue/template_gitignore b/templates/Microsoft.AspNetCore.SpaTemplates/Content/vue/.gitignore similarity index 100% rename from templates/Microsoft.AspNetCore.SpaTemplates/Content/vue/template_gitignore rename to templates/Microsoft.AspNetCore.SpaTemplates/Content/vue/.gitignore diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/angular/template_gitignore b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/angular/.gitignore similarity index 100% rename from templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/angular/template_gitignore rename to templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/angular/.gitignore diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/template_gitignore b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/.gitignore similarity index 100% rename from templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/template_gitignore rename to templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/react/.gitignore diff --git a/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/template_gitignore b/templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/.gitignore similarity index 100% rename from templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/template_gitignore rename to templates/Microsoft.DotNet.Web.Spa.ProjectTemplates/Content/redux/.gitignore diff --git a/templates/package-builder/src/build/build.ts b/templates/package-builder/src/build/build.ts index 3abc13d..ee57fc1 100644 --- a/templates/package-builder/src/build/build.ts +++ b/templates/package-builder/src/build/build.ts @@ -9,7 +9,7 @@ import * as childProcess from 'child_process'; import * as targz from 'tar.gz'; const isWindows = /^win/.test(process.platform); -const textFileExtensions = ['.gitignore', 'template_gitignore', '.config', '.cs', '.cshtml', '.csproj', '.html', '.js', '.json', '.jsx', '.md', '.nuspec', '.ts', '.tsx']; +const textFileExtensions = ['.gitignore', '.config', '.cs', '.cshtml', '.csproj', '.html', '.js', '.json', '.jsx', '.md', '.nuspec', '.ts', '.tsx']; const dotNetPackages = [ 'Microsoft.DotNet.Web.Spa.ProjectTemplates', @@ -28,10 +28,7 @@ function writeFileEnsuringDirExists(root: string, filename: string, contents: st } function listFilesExcludingGitignored(root: string): string[] { - // Note that the gitignore files, prior to be written by the generator, are called 'template_gitignore' - // instead of '.gitignore'. This is a workaround for Yeoman doing strange stuff with .gitignore files - // (it renames them to .npmignore, which is not helpful). - let gitIgnorePath = path.join(root, 'template_gitignore'); + let gitIgnorePath = path.join(root, '.gitignore'); let gitignoreEvaluator = fs.existsSync(gitIgnorePath) ? gitignore.compile(fs.readFileSync(gitIgnorePath, 'utf8')) : { accepts: () => true }; @@ -99,8 +96,7 @@ function buildDotNetNewNuGetPackage(packageId: string) { const sourceProjectName = 'WebApplicationBasic'; const projectGuid = '00000000-0000-0000-0000-000000000000'; const filenameReplacements = [ - { from: /.*\.csproj$/, to: `${sourceProjectName}.csproj` }, - { from: /\btemplate_gitignore$/, to: '.gitignore' } + { from: /.*\.csproj$/, to: `${sourceProjectName}.csproj` } ]; const contentReplacements = [];