mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build(bazel): replace ignore example feature with bazel equivalent
Comment out the entry in the EXAMPLES map to ignore an example.
This commit is contained in:
committed by
Joey Perrott
parent
9a27c4cb50
commit
7c8ca113c1
@@ -87,12 +87,11 @@ function writeStackBlitzFile(exampleName, examplePath) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy all the files from the `sourcePath`, which are not ignored by the `.gitignore` file in the
|
||||
* `EXAMPLES_BASE_PATH`, to the `examplePath`.
|
||||
* Copy all the files from the `sourcePath` to the `examplePath`, except for files
|
||||
* ignored by the source example.
|
||||
*/
|
||||
function copyExampleFiles(sourcePath, examplePath, exampleName) {
|
||||
const gitIgnoreSource = getGitIgnore(sourcePath);
|
||||
const gitIgnoreExamples = getGitIgnore(EXAMPLES_BASE_PATH);
|
||||
|
||||
// Grab the files in the source folder and filter them based on the gitignore rules.
|
||||
const sourceFiles =
|
||||
@@ -106,8 +105,6 @@ function copyExampleFiles(sourcePath, examplePath, exampleName) {
|
||||
.filter(filePath => !/\/$/.test(filePath))
|
||||
// Filter out files that match the source directory .gitignore rules
|
||||
.filter(filePath => !gitIgnoreSource.ignores(filePath))
|
||||
// Filter out files that match the examples directory .gitignore rules
|
||||
.filter(filePath => !gitIgnoreExamples.ignores(path.join(exampleName, filePath)));
|
||||
|
||||
for (const sourceFile of sourceFiles) {
|
||||
console.log(' - ', sourceFile);
|
||||
|
||||
Reference in New Issue
Block a user