github.com/jfrog/jfrog-cli-core@v1.12.1/artifactory/utils/yarn/yarn.go (about)

     1  package yarn
     2  
     3  import (
     4  	gofrogcmd "github.com/jfrog/gofrog/io"
     5  	"github.com/jfrog/jfrog-client-go/utils/errorutils"
     6  )
     7  
     8  func RunCustomCmd(args []string, executablePath string) error {
     9  	customCmdConfig := createCustomCmdConfig(executablePath, args)
    10  	if err := gofrogcmd.RunCmd(customCmdConfig); err != nil {
    11  		return errorutils.CheckError(err)
    12  	}
    13  
    14  	return nil
    15  }
    16  
    17  func createCustomCmdConfig(executablePath string, args []string) *YarnConfig {
    18  	return &YarnConfig{
    19  		Executable: executablePath,
    20  		Command:    args,
    21  		StrWriter:  nil,
    22  		ErrWriter:  nil,
    23  	}
    24  }