Skip to content

Commit

Permalink
Fixes #808
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Dec 1, 2019
1 parent e62ebfa commit 45a8135
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ try {
elev.setIncrementalBuild(argv.incremental);
elev.setPassthroughAll(argv.passthroughall);
elev.setFormats(argv.formats);

let isVerbose = process.env.DEBUG ? false : !argv.quiet;
elev.setIsVerbose(isVerbose);
if (argv.quiet) {
elev.setIsVerbose(false);
}

// careful, we can’t use async/await here to error properly
// with old node versions in `please-upgrade-node` above.
Expand Down
5 changes: 3 additions & 2 deletions src/Eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Eleventy {
* @member {Boolean} - Is Eleventy running in verbose mode?
* @default true
*/
this.isVerbose = true;
this.isVerbose = process.env.DEBUG ? false : !this.config.quietMode;

/**
* @member {Boolean} - Is Eleventy running in debug mode?
Expand Down Expand Up @@ -290,7 +290,8 @@ Data: ${this.templateData.getDataDir()}
Includes: ${this.eleventyFiles.getIncludesDir()}
Layouts: ${this.eleventyFiles.getLayoutsDir()}
Output: ${this.outputDir}
Template Formats: ${formats.join(",")}`);
Template Formats: ${formats.join(",")}
Verbose Output: ${this.isVerbose}`);

this.writer.setVerboseOutput(this.isVerbose);
this.writer.setDryRun(this.isDryRun);
Expand Down
9 changes: 8 additions & 1 deletion src/UserConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class UserConfig {

// using Map to preserve insertion order
this.dataExtensions = new Map();

this.quietMode = false;
}

versionCheck(expected) {
Expand Down Expand Up @@ -577,6 +579,10 @@ class UserConfig {
this.frontMatterParsingOptions = options;
}

setQuietMode(quietMode) {
this.quietMode = !!quietMode;
}

getMergingConfigObject() {
return {
templateFormats: this.templateFormats,
Expand Down Expand Up @@ -613,7 +619,8 @@ class UserConfig {
additionalWatchTargets: this.additionalWatchTargets,
browserSyncConfig: this.browserSyncConfig,
frontMatterParsingOptions: this.frontMatterParsingOptions,
dataExtensions: this.dataExtensions
dataExtensions: this.dataExtensions,
quietMode: this.quietMode
};
}

Expand Down

0 comments on commit 45a8135

Please sign in to comment.