Skip to content

Commit b894163

Browse files
committed
Fix an issue with rush publish --pack with yarn.
1 parent 4b1d1a2 commit b894163

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,14 @@ export class PublishAction extends BaseRushAction {
473473
private _calculateTarballName(project: RushConfigurationProject): string {
474474
// Same logic as how npm forms the tarball name
475475
const packageName: string = project.packageName;
476-
const name: string = packageName[0] === '@' ?
477-
packageName.substr(1).replace(/\//g, '-') : packageName;
476+
const name: string = packageName[0] === '@' ? packageName.substr(1).replace(/\//g, '-') : packageName;
478477

479-
return `${name}-${project.packageJson.version}.tgz`;
478+
if (this.rushConfiguration.packageManager === 'yarn') {
479+
// yarn tarballs have a "v" before the version number
480+
return `${name}-v${project.packageJson.version}.tgz`;
481+
} else {
482+
return `${name}-${project.packageJson.version}.tgz`;
483+
}
480484
}
481485

482486
private _setDependenciesBeforePublish(): void {

0 commit comments

Comments
 (0)