github.com/jfrog/jfrog-cli-core/v2@v2.52.0/artifactory/commands/npm/common.go (about)

     1  package npm
     2  
     3  import (
     4  	"github.com/jfrog/jfrog-cli-core/v2/common/build"
     5  	"github.com/jfrog/jfrog-cli-core/v2/utils/config"
     6  )
     7  
     8  const (
     9  	npmConfigAuthEnv       = "npm_config_%s:_auth"
    10  	npmVersionForLegacyEnv = "9.3.1"
    11  	npmLegacyConfigAuthEnv = "npm_config__auth"
    12  )
    13  
    14  type CommonArgs struct {
    15  	repo               string
    16  	buildConfiguration *build.BuildConfiguration
    17  	npmArgs            []string
    18  	serverDetails      *config.ServerDetails
    19  }
    20  
    21  func (ca *CommonArgs) SetServerDetails(serverDetails *config.ServerDetails) *CommonArgs {
    22  	ca.serverDetails = serverDetails
    23  	return ca
    24  }
    25  
    26  func (ca *CommonArgs) SetNpmArgs(npmArgs []string) *CommonArgs {
    27  	ca.npmArgs = npmArgs
    28  	return ca
    29  }
    30  
    31  func (ca *CommonArgs) SetBuildConfiguration(buildConfiguration *build.BuildConfiguration) *CommonArgs {
    32  	ca.buildConfiguration = buildConfiguration
    33  	return ca
    34  }
    35  
    36  func (ca *CommonArgs) SetRepo(repo string) *CommonArgs {
    37  	ca.repo = repo
    38  	return ca
    39  }