Skip to content

Commit

Permalink
Merge pull request #481 from c0d3d/no-colors-for-non-interactive
Browse files Browse the repository at this point in the history
Disable colors for non-interactive output
  • Loading branch information
hassankhan authored Apr 7, 2019
2 parents ba6b0f3 + 720b17b commit 57957ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const _ = require('lodash');
const BbPromise = require('bluebird');
const webpack = require('webpack');
const tty = require('tty');

module.exports = {
compile() {
Expand All @@ -20,7 +21,7 @@ module.exports = {

const compileOutputPaths = [];
const consoleStats = this.webpackConfig.stats || _.get(this, 'webpackConfig[0].stats') || {
colors: true,
colors: tty.isatty(process.stdout.fd),
hash: false,
version: false,
chunks: false,
Expand Down
3 changes: 2 additions & 1 deletion lib/wpwatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const _ = require('lodash');
const BbPromise = require('bluebird');
const webpack = require('webpack');
const tty = require('tty');

module.exports = {
wpwatch() {
Expand All @@ -23,7 +24,7 @@ module.exports = {

const compiler = webpack(this.webpackConfig);
const consoleStats = this.webpackConfig.stats || {
colors: true,
colors: tty.isatty(process.stdout.fd),
hash: false,
version: false,
chunks: false,
Expand Down

0 comments on commit 57957ce

Please sign in to comment.