Skip to content

Commit d883fc9

Browse files
fix: show only warnings from Yarn when verbose mode is enabled (#2445)
1 parent dad6710 commit d883fc9

File tree

1 file changed

+4
-4
lines changed
  • packages/cli/src/commands/init

1 file changed

+4
-4
lines changed

packages/cli/src/commands/init/init.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ interface TemplateReturnType {
8787
// Here we are defining explicit version of Yarn to be used in the new project because in some cases providing `3.x` don't work.
8888
const YARN_VERSION = '3.6.4';
8989

90-
const bumpYarnVersion = async (silent: boolean, root: string) => {
90+
const bumpYarnVersion = async (root: string) => {
9191
try {
9292
let yarnVersion = semver.parse(getYarnVersionIfAvailable());
9393

@@ -99,14 +99,14 @@ const bumpYarnVersion = async (silent: boolean, root: string) => {
9999
}
100100
await executeCommand('yarn', setVersionArgs, {
101101
root,
102-
silent,
102+
silent: !logger.isVerbose(),
103103
});
104104

105105
// React Native doesn't support PnP, so we need to set nodeLinker to node-modules. Read more here: https://github.com/react-native-community/cli/issues/27#issuecomment-1772626767
106106
await executeCommand(
107107
'yarn',
108108
['config', 'set', 'nodeLinker', 'node-modules'],
109-
{root, silent},
109+
{root, silent: !logger.isVerbose()},
110110
);
111111
}
112112
} catch (e) {
@@ -286,7 +286,7 @@ async function createFromTemplate({
286286
});
287287

288288
if (packageManager === 'yarn' && shouldBumpYarnVersion) {
289-
await bumpYarnVersion(false, projectDirectory);
289+
await bumpYarnVersion(projectDirectory);
290290
}
291291

292292
loader.succeed();

0 commit comments

Comments
 (0)