diff --git a/src/cli/commands/run.js b/src/cli/commands/run.js index 02a71610f0..b6c424de21 100644 --- a/src/cli/commands/run.js +++ b/src/cli/commands/run.js @@ -75,6 +75,8 @@ export async function run(config: Config, reporter: Reporter, flags: Object, arg } if (cmds.length) { + // propagate YARN_SILENT env variable to executed commands + process.env.YARN_SILENT = '1'; for (const [stage, cmd] of cmds) { // only tack on trailing arguments for default script, ignore for pre and post - #1595 const defaultScriptCmd = `${cmd} ${sanitizedArgs(args).join(' ')}`; diff --git a/src/cli/index.js b/src/cli/index.js index 109051dbb4..a4f8b4dce5 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -118,7 +118,7 @@ const reporter = new Reporter({ emoji: process.stdout.isTTY && commander.emoji, verbose: commander.verbose, noProgress: !commander.progress, - isSilent: commander.silent, + isSilent: process.env.YARN_SILENT === '1' || commander.silent, }); reporter.initPeakMemoryCounter();