@@ -500,26 +500,12 @@ export class PublishAction extends BaseRushAction {
500500 }
501501 }
502502
503- private _addNpmPublishHome ( ) : void {
504- // Example: "common\config\rush\.npmrc-publish"
505- const sourceNpmrcPublishPath : string = path . join ( this . rushConfiguration . commonRushConfigFolder , '.npmrc-publish' ) ;
506-
507- try {
508- // Check if .npmrc-publish file exists to use for publishing
509- if ( FileSystem . exists ( sourceNpmrcPublishPath ) ) {
510- // Sync "common\config\rush\.npmrc-publish" --> "common\temp\publish-home\.npmrc"
511- Utilities . createFolderWithRetry ( this . _targetNpmrcPublishFolder ) ;
512-
513- // Copy down the committed .npmrc-publish file, if there is one
514- Utilities . copyAndTrimNpmrcFile ( sourceNpmrcPublishPath , this . _targetNpmrcPublishPath ) ;
515- } else if ( FileSystem . exists ( this . _targetNpmrcPublishPath ) ) {
516- // If the source .npmrc-publish doesn't exist and there is one in the target, delete the one in the target
517- console . log ( `Deleting ${ this . _targetNpmrcPublishPath } ` ) ;
518- FileSystem . deleteFile ( this . _targetNpmrcPublishPath ) ;
519- }
520- } catch ( e ) {
521- throw new Error ( `Error syncing .npmrc-publish file: ${ e } ` ) ;
522- }
503+ private _addNpmPublishHome ( ) : void {
504+ // Create "common\temp\publish-home" folder, if it doesn't exist
505+ Utilities . createFolderWithRetry ( this . _targetNpmrcPublishFolder ) ;
506+
507+ // Copy down the committed "common\config\rush\.npmrc-publish" file, if there is one
508+ Utilities . syncNpmrc ( this . rushConfiguration . commonRushConfigFolder , this . _targetNpmrcPublishFolder , true ) ;
523509 }
524510
525511 private _addSharedNpmConfig ( env : { [ key : string ] : string | undefined } , args : string [ ] ) : void {
0 commit comments