Skip to content

Commit 6e382e1

Browse files
authored
Merge pull request microsoft#4338 from iclanton/fix-tty
[rush] Fix pnpm's install status printing when pnpm custom tips are defined.
2 parents bc7969c + dc4b151 commit 6e382e1

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "Fix pnpm's install status printing when pnpm custom tips are defined.",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush"
10+
}

common/config/rush/version-policies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"policyName": "rush",
104104
"definitionName": "lockStepVersion",
105105
"version": "5.107.0",
106-
"nextBump": "minor",
106+
"nextBump": "patch",
107107
"mainProject": "@microsoft/rush"
108108
}
109109
]

libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,26 @@ export class WorkspaceInstallManager extends BaseInstallManager {
493493
args.push('--recursive');
494494
args.push('--link-workspace-packages', 'false');
495495

496+
if (process.stdout.isTTY) {
497+
// If we're on a TTY console and something else didn't set a `--reporter` parameter,
498+
// explicitly set the default reporter. This fixes an issue where, when the pnpm
499+
// output is being monitored to match custom tips, pnpm will detect a non-TTY
500+
// stdout stream and use the `append-only` reporter.
501+
//
502+
// See docs here: https://pnpm.io/cli/install#--reportername
503+
let includesReporterArg: boolean = false;
504+
for (const arg of args) {
505+
if (arg.startsWith('--reporter')) {
506+
includesReporterArg = true;
507+
break;
508+
}
509+
}
510+
511+
if (!includesReporterArg) {
512+
args.push('--reporter', 'default');
513+
}
514+
}
515+
496516
for (const arg of this.options.pnpmFilterArguments) {
497517
args.push(arg);
498518
}

0 commit comments

Comments
 (0)