[
https://issues.apache.org/jira/browse/CB-13925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16379398#comment-16379398
]
ASF GitHub Bot commented on CB-13925:
-------------------------------------
stevengill closed pull request #793: [CB-13925] Making file fetch happen on
every build.
URL: https://github.com/apache/cordova-docs/pull/793
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/gulpfile.js b/gulpfile.js
index 2f0dbf6a7..f6dd2d5e5 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -313,13 +313,16 @@ gulp.task("regen", ["jekyll"], function () {
});
gulp.task("fetch", function (done) {
- if (!fs.existsSync(FETCH_DIR)) {
- exec("node", [bin("fetch_docs.js"), "--config", FETCH_CONFIG,
'--docsRoot', DOCS_DIR], done);
- } else {
+
+ // skip fetching if --nofetch was passed
+ if (gutil.env.nofetch) {
gutil.log(gutil.colors.yellow(
- "Skipping fetching external docs. Run 'gulp clean' first to
initiate another fetch."));
+ "Skipping fetching external docs."));
done();
+ return;
}
+
+ exec("node", [bin("fetch_docs.js"), "--config", FETCH_CONFIG,
'--docsRoot', DOCS_DIR], done);
});
gulp.task("reload", function () {
diff --git a/package.json b/package.json
index 5079f1ec6..33cdbee30 100644
--- a/package.json
+++ b/package.json
@@ -22,6 +22,7 @@
"baconjs": "^0.7.70",
"browser-sync": "^2.8.0",
"browserify": "^10.2.4",
+ "chalk": "^2.3.1",
"cheerio": "^0.17.0",
"classnames": "^2.1.2",
"envify": "^3.4.0",
diff --git a/tools/bin/augment_toc.js b/tools/bin/augment_toc.js
index 7b12d51fd..b29f19458 100644
--- a/tools/bin/augment_toc.js
+++ b/tools/bin/augment_toc.js
@@ -22,6 +22,7 @@ var path = require('path');
var yaml = require('js-yaml');
var optimist = require('optimist');
+var chalk = require('chalk');
var util = require('./util');
@@ -46,7 +47,7 @@ function augmentEntry (originalEntry, prefix) {
// skip entries that don't point to a valid file
if (!fs.existsSync(filePath)) {
- console.warn('WARNING! Possible 404 in ToC: "' + filePath + '"');
+ console.warn(chalk.red('WARNING! Possible 404 in ToC: "' + filePath +
'"; create the file to fix'));
return originalEntry;
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Files in www/docs/en/dev/reference are not fetched on every build.
> ------------------------------------------------------------------
>
> Key: CB-13925
> URL: https://issues.apache.org/jira/browse/CB-13925
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-docs
> Reporter: Dmitry Blotsky
> Priority: Major
>
> Some files in the docs are downloaded from external sources, into
> {{www/docs/en/dev/reference}}. The files and their sources are defined in
> {{cordova-docs/www/_data/fetched-files.yml}}, and downloaded by the {{gulp
> fetch}} task, which runs on every build.
> Expected behaviour: the files are fetched every time the command runs.
> Actual behaviour: the files are only fetched if the
> {{www/docs/en/dev/reference}} directory doesn't exist. That is, fetching is
> skipped every time after the first time.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]