From 76489f9c8e03a72be032866218dc76ac94c54120 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 30 May 2017 18:52:44 +0100 Subject: [PATCH] Put yarn into silent mode when calling nested `yarn run` commands (#3536) --- src/cli/commands/run.js | 2 ++ src/cli/index.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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();