Skip to content

Commit a011938

Browse files
authored
Merge pull request microsoft#883 from Microsoft/pgonzal/yarn-publish
[rush] Fix an issue where "rush publish" didn't work with Yarn
2 parents a16659d + 5fc9ee7 commit a011938

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎apps/rush-lib/src/cli/actions/PublishAction.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,15 @@ export class PublishAction extends BaseRushAction {
346346
args.push(`--force`);
347347
}
348348

349+
// TODO: Yarn's "publish" command line is fairly different from NPM and PNPM. The right thing to do here
350+
// would be to remap our options to the Yarn equivalents. But until we get around to that, we'll simply invoke
351+
// whatever NPM binary happens to be installed in the global path.
352+
const packageManagerToolFilename: string = this.rushConfiguration.packageManager === 'yarn'
353+
? 'npm' : this.rushConfiguration.packageManagerToolFilename;
354+
349355
PublishUtilities.execCommand(
350356
!!this._publish.value,
351-
this.rushConfiguration.packageManagerToolFilename,
357+
packageManagerToolFilename,
352358
args,
353359
packagePath,
354360
env);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "Fix an issue where \"rush publish\" invoked the wrong command when using Yarn",
5+
"packageName": "@microsoft/rush",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}

0 commit comments

Comments
 (0)