Skip to content

Commit

Permalink
🏗 Enable gulp log coloring during CI (#32156)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha committed Jan 25, 2021
1 parent 6c62105 commit 88ae7fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build-system/pr-check/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ function abortTimedJob(jobName, startTime) {
function timedExecFn(execFn) {
return (cmd, ...rest) => {
const startTime = startTimer(cmd);
const p = execFn(cmd, ...rest);
const cmdToRun =
isCiBuild() && cmd.startsWith('gulp ') ? cmd.concat(' --color') : cmd;
const p = execFn(cmdToRun, ...rest);
stopTimer(cmd, startTime);
return p;
};
Expand Down
4 changes: 4 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
const argv = require('minimist')(process.argv.slice(2));
const gulp = require('gulp-help')(require('gulp'));
const {cyan, red} = require('ansi-colors');
const {isCiBuild} = require('./build-system/common/ci');
const {log} = require('./build-system/common/logging');

const {
Expand Down Expand Up @@ -100,6 +101,9 @@ function checkFlags(name, taskFunc) {
return; // This isn't the task being run.
}
const validFlags = taskFunc.flags ? Object.keys(taskFunc.flags) : [];
if (isCiBuild()) {
validFlags.push('color'); // Used to enable log coloring during CI.
}
const usedFlags = Object.keys(argv).slice(1); // Skip the '_' argument
const invalidFlags = [];
usedFlags.forEach((flag) => {
Expand Down

0 comments on commit 88ae7fe

Please sign in to comment.