GeezerVison is showing github.com — refactor(@angular/cli): Updates .gitignore to keep out VSCode and Int… · console-cat/angular-cli@76b13e2
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .gitignore +19-1Lines changed: 19 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
5 | 5 | dist-schema/ |
6 | 6 |
|
7 | 7 | # IDEs |
8 | | -.idea/ |
9 | 8 | jsconfig.json |
| 9 | + |
| 10 | +# Intellij IDEA/WebStorm |
| 11 | +# https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 |
| 12 | +.idea/**/workspace.xml |
| 13 | +.idea/**/tasks.xml |
| 14 | +.idea/**/usage.statistics.xml |
| 15 | +.idea/**/dictionaries |
| 16 | +.idea/**/shelf |
| 17 | + |
| 18 | +# Also ignore code styles because .editorconfig is used instead. |
| 19 | +.idea/codeStyles/ |
| 20 | + |
| 21 | +# VSCode |
| 22 | +# https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore |
10 | 23 | .vscode/ |
| 24 | +!.vscode/settings.json |
| 25 | +!.vscode/tasks.json |
| 26 | +!.vscode/launch.json |
| 27 | +!.vscode/extensions.json |
| 28 | +**/*.code-workspace |
11 | 29 |
|
12 | 30 | # Typings file. |
13 | 31 | typings/ |
|
Collapse file
Copy file name to clipboardExpand all lines: scripts/build.ts +12-4Lines changed: 12 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -17,15 +17,23 @@ import buildSchema from './build-schema'; |
17 | 17 | const minimatch = require('minimatch'); |
18 | 18 | const tar = require('tar'); |
19 | 19 |
|
20 | | -const gitIgnore = fs.readFileSync(path.join(__dirname, '../.gitignore'), 'utf-8') |
21 | | - .split('\n') |
| 20 | +const gitIgnoreFiles = fs.readFileSync(path.join(__dirname, '../.gitignore'), 'utf-8') |
| 21 | + .split('\n'); |
| 22 | +const gitIgnore = gitIgnoreFiles |
22 | 23 | .map(line => line.replace(/#.*/, '')) |
| 24 | + .filter((line) => !line.startsWith('!')) |
23 | 25 | .filter(line => !line.match(/^\s*$/)); |
| 26 | +const gitIgnoreExcept = gitIgnoreFiles |
| 27 | + .filter((line) => line.startsWith('!')) |
| 28 | + .map((line) => line.substr(1)); |
24 | 29 |
|
25 | | - |
26 | | -function _gitIgnoreMatch(p: string) { |
| 30 | +function _gitIgnoreMatch(p: string): boolean { |
27 | 31 | p = path.relative(path.dirname(__dirname), p); |
28 | 32 |
|
| 33 | + if (gitIgnoreExcept.some((line) => minimatch(p, line))) { |
| 34 | + return false; |
| 35 | + } |
| 36 | + |
29 | 37 | return gitIgnore.some(line => minimatch(p, line)); |
30 | 38 | } |
31 | 39 |
|
|