Documentation ¶
Index ¶
- type ExecRunner
- type Execute
- func (exec *Execute) FindPackageJSONFiles() []string
- func (exec *Execute) FindPackageJSONFilesWithScript(packageJSONFiles []string, script string) ([]string, error)
- func (exec *Execute) InstallAllDependencies(packageJSONFiles []string) error
- func (exec *Execute) RunScriptsInAllPackages(runScripts []string, runOptions []string, virtualFrameBuffer bool) error
- func (exec *Execute) SetNpmRegistries() error
- type Executor
- type ExecutorOptions
- type Utils
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecRunner ¶ added in v1.46.0
type ExecRunner interface { SetEnv(e []string) Stdout(out io.Writer) Stderr(out io.Writer) RunExecutable(executable string, params ...string) error RunExecutableInBackground(executable string, params ...string) (command.Execution, error) }
ExecRunner interface to enable mocking for testing
type Execute ¶ added in v1.46.0
type Execute struct { Utils Utils Options ExecutorOptions }
Execute struct holds utils to enable mocking and common parameters
func (*Execute) FindPackageJSONFiles ¶ added in v1.46.0
FindPackageJSONFiles returns a list of all package.json fileUtils of the project excluding node_modules and gen/ directories
func (*Execute) FindPackageJSONFilesWithScript ¶ added in v1.46.0
func (exec *Execute) FindPackageJSONFilesWithScript(packageJSONFiles []string, script string) ([]string, error)
FindPackageJSONFilesWithScript returns a list of package.json fileUtils that contain the script
func (*Execute) InstallAllDependencies ¶ added in v1.46.0
InstallAllDependencies executes npm or yarn Install for all package.json fileUtils defined in packageJSONFiles
func (*Execute) RunScriptsInAllPackages ¶ added in v1.46.0
func (exec *Execute) RunScriptsInAllPackages(runScripts []string, runOptions []string, virtualFrameBuffer bool) error
RunScriptsInAllPackages runs all scripts defined in ExecuteOptions.RunScripts
func (*Execute) SetNpmRegistries ¶ added in v1.46.0
SetNpmRegistries configures the given npm registries. CAUTION: This will change the npm configuration in the user's home directory.
type Executor ¶ added in v1.46.0
type Executor interface { FindPackageJSONFiles() []string FindPackageJSONFilesWithScript(packageJSONFiles []string, script string) ([]string, error) RunScriptsInAllPackages(runScripts []string, runOptions []string, virtualFrameBuffer bool) error InstallAllDependencies(packageJSONFiles []string) error SetNpmRegistries() error }
Executor interface to enable mocking for testing
func NewExecutor ¶ added in v1.46.0
func NewExecutor(executorOptions ExecutorOptions) Executor
NewExecutor instantiates Execute struct and sets executeOptions
type ExecutorOptions ¶ added in v1.46.0
type ExecutorOptions struct { DefaultNpmRegistry string SapNpmRegistry string ExecRunner ExecRunner }
ExecutorOptions holds common parameters for functions of Executor