Skip to content

Commit 5e2e459

Browse files
committed
CB-13925: (docs) Adding --nofetch option to Gulp build, and making Gulp always fetch files on build. Improving error message in augment_toc.js a bit.
1 parent 01ed8a4 commit 5e2e459

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

gulpfile.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,16 @@ gulp.task("regen", ["jekyll"], function () {
313313
});
314314

315315
gulp.task("fetch", function (done) {
316-
if (!fs.existsSync(FETCH_DIR)) {
317-
exec("node", [bin("fetch_docs.js"), "--config", FETCH_CONFIG, '--docsRoot', DOCS_DIR], done);
318-
} else {
316+
317+
// skip fetching if --nofetch was passed
318+
if (gutil.env.nofetch) {
319319
gutil.log(gutil.colors.yellow(
320-
"Skipping fetching external docs. Run 'gulp clean' first to initiate another fetch."));
320+
"Skipping fetching external docs."));
321321
done();
322+
return;
322323
}
324+
325+
exec("node", [bin("fetch_docs.js"), "--config", FETCH_CONFIG, '--docsRoot', DOCS_DIR], done);
323326
});
324327

325328
gulp.task("reload", function () {

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"baconjs": "^0.7.70",
2323
"browser-sync": "^2.8.0",
2424
"browserify": "^10.2.4",
25+
"chalk": "^2.3.1",
2526
"cheerio": "^0.17.0",
2627
"classnames": "^2.1.2",
2728
"envify": "^3.4.0",

tools/bin/augment_toc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var path = require('path');
2222

2323
var yaml = require('js-yaml');
2424
var optimist = require('optimist');
25+
var chalk = require('chalk');
2526

2627
var util = require('./util');
2728

@@ -46,7 +47,7 @@ function augmentEntry (originalEntry, prefix) {
4647

4748
// skip entries that don't point to a valid file
4849
if (!fs.existsSync(filePath)) {
49-
console.warn('WARNING! Possible 404 in ToC: "' + filePath + '"');
50+
console.warn(chalk.red('WARNING! Possible 404 in ToC: "' + filePath + '"; create the file to fix'));
5051
return originalEntry;
5152
}
5253

0 commit comments

Comments
 (0)