Skip to content

Commit

Permalink
Disable colors for non-interactive output
Browse files Browse the repository at this point in the history
  • Loading branch information
c0d3d committed Jan 30, 2019
1 parent 61e62db commit a7b0981
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 a7b0981

Please sign in to comment.