From 891846f232da42474ab902792a655b21319daf61 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Sat, 26 Nov 2016 06:03:01 -0800 Subject: [PATCH] chore(gulp): selectively shred guide examples using --filter (#2876) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit E.g., `gulp _shred-devguide-examples --filter=dep` Also removed docs/README.md since it was reporting something that is no longer true (we don’t commit `_fragments` anymore). --- gulpfile.js | 5 +++-- public/docs/README.md | 6 ------ 2 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 public/docs/README.md diff --git a/gulpfile.js b/gulpfile.js index 8f776d687a..ce637ec6fe 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -823,7 +823,8 @@ gulp.task('_harp-compile', function() { gulp.task('_shred-devguide-examples', ['_shred-clean-devguide', '_copy-example-boilerplate'], function() { // Split big shredding task into partials 2016-06-14 - var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['**/node_modules', '**/_boilerplate']}); + const exPath = path.join(EXAMPLES_PATH, (argv.filter || '') + '*'); + var examplePaths = globby.sync(exPath, {ignore: ['**/node_modules', '**/_boilerplate']}); var promise = Promise.resolve(true); examplePaths.forEach(function (examplePath) { promise = promise.then(() => docShredder.shredSingleExampleDir(_devguideShredOptions, examplePath)); @@ -847,7 +848,7 @@ gulp.task('_shred-clean-devguide-shared-jade', function(cb) { }); gulp.task('_shred-clean-devguide', function(cb) { - var cleanPath = path.join(_devguideShredOptions.fragmentsDir, '**/*.*') + var cleanPath = path.join(_devguideShredOptions.fragmentsDir, (argv.filter || '*') + '*/*.*') return del([ cleanPath, '!**/*.ovr.*', '!**/_api/**']); }); diff --git a/public/docs/README.md b/public/docs/README.md deleted file mode 100644 index 95d331b115..0000000000 --- a/public/docs/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Why the _fragments dir is checked in - -Within this repo files generated as a result of shredding the `_examples` dir ( the contents of the `_fragments` dir) are checked in so that we can avoid running the -shredder over the entire `_examples` dir each time someone refreshes the repo ( the `shred-full` gulp task). -The gulp `serve-and-watch` shredder is only a ‘partial’ shredder. It only shred’s files in directories changed during -the current session.