Skip to content

Commit 937de2e

Browse files
committed
Fix "rush publish" to work with Yarn
1 parent a16659d commit 937de2e

1 file changed

Lines changed: 7 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);

0 commit comments

Comments
 (0)