10000 Remove the Yeoman-specific gitignore workaround · aspnet/JavaScriptServices@8d6119f · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 8d6119f

Browse files
Remove the Yeoman-specific gitignore workaround
1 parent 0291686 commit 8d6119f

File tree

7 files changed

+3
-7
lines changed

7 files changed

+3
-7
lines changed

templates/package-builder/src/build/build.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as childProcess from 'child_process';
99
import * as targz from 'tar.gz';
1010

1111
const isWindows = /^win/.test(process.platform);
12-
const textFileExtensions = ['.gitignore', 'template_gitignore', '.config', '.cs', '.cshtml', '.csproj', '.html', '.js', '.json', '.jsx', '.md', '.nuspec', '.ts', '.tsx'];
12+
const textFileExtensions = ['.gitignore', '.config', '.cs', '.cshtml', '.csproj', '.html', '.js', '.json', '.jsx', '.md', '.nuspec', '.ts', '.tsx'];
1313

1414
const dotNetPackages = [
1515
'Microsoft.DotNet.Web.Spa.ProjectTemplates',
@@ -28,10 +28,7 @@ function writeFileEnsuringDirExists(root: string, filename: string, contents: st
2828
}
2929

3030
function listFilesExcludingGitignored(root: string): string[] {
31-
// Note that the gitignore files, prior to be written by the generator, are called 'template_gitignore'
32-
// instead of '.gitignore'. This is a workaround for Yeoman doing strange stuff with .gitignore files
33-
// (it renames them to .npmignore, which is not helpful).
34-
let gitIgnorePath = path.join(root, 'template_gitignore');
31+
let gitIgnorePath = path.join(root, '.gitignore');
3532
let gitignoreEvaluator = fs.existsSync(gitIgnorePath)
3633
? gitignore.compile(fs.readFileSync(gitIgnorePath, 'utf8'))
3734
: { accepts: () => true };
@@ -99,8 +96,7 @@ function buildDotNetNewNuGetPackage(packageId: string) {
9996
const sourceProjectName = 'WebApplicationBasic';
10097
const projectGuid = '00000000-0000-0000-0000-000000000000';
10198
const filenameReplacements = [
102-
{ from: /.*\.csproj$/, to: `${sourceProjectName}.csproj` },
103-
{ from: /\btemplate_gitignore$/, to: '.gitignore' }
99+
{ from: /.*\.csproj$/, to: `${sourceProjectName}.csproj` }
104100
];
105101
const contentReplacements = [];
106102

0 commit comments

Comments
 (0)
0