shell

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package shell defines OS level ways to interact with node package managers and git command.

Index

Constants

View Source
const GitBin = "git"

GitBin is the git binary name.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitShell

type GitShell struct {
	// contains filtered or unexported fields
}

GitShell is a Shell implementation used to interact with a npnClient.

func NewGitClient

func NewGitClient() *GitShell

NewGitClient returns a pointer to a NodePackageManager struct.

func (*GitShell) GetShell

func (s *GitShell) GetShell() Shell

GetShell returns a Shell.

func (*GitShell) RunGitClone

func (s *GitShell) RunGitClone(repoURL, inpath string, silentMode bool) error

RunGitClone execute 'git clone' command.

func (*GitShell) RunInit

func (s *GitShell) RunInit(localPath string, silentMode bool) error

RunInit execute 'git init' command to initialize an empty git repository.

func (*GitShell) RunSubmodule

func (s *GitShell) RunSubmodule(repoURL, inpath string, silentMode bool) error

RunSubmodule execute the 'git submodule add' command.

type LocalShell

type LocalShell struct {
}

LocalShell is a Shell implementation.

func (*LocalShell) BackgroundExecute

func (s *LocalShell) BackgroundExecute(ctx context.Context, cmdName string, cmdOptions string, packageList string) ([]byte, error)

BackgroundExecute runs an action on the npm client in background.

func (*LocalShell) Execute

func (s *LocalShell) Execute(cmdName string, cmdOptions string, silentMode bool) error

Execute runs command on the local system.

type NPMClient

type NPMClient struct {
	// contains filtered or unexported fields
}

NPMClient is a Shell implementation used to interact with a npnClient.

func NewNPMClient

func NewNPMClient() *NPMClient

NewNPMClient returns a pointer to a NodePackageManager struct.

func (*NPMClient) GetShell

func (s *NPMClient) GetShell() Shell

GetShell returns a Shell.

func (*NPMClient) RunAddPackages

func (s *NPMClient) RunAddPackages(pmName string, operation string, mode string, packages []string, silentMode bool) error

RunAddPackages execute the relative npmClient install|add package command.

func (*NPMClient) RunInstall

func (s *NPMClient) RunInstall(pmName string, operation string, silentMode bool) error

RunInstall execute the relative npmClient install command.

func (*NPMClient) RunSvelteKitCommand

func (s *NPMClient) RunSvelteKitCommand(pmName string, operation string, silentMode bool) (err error)

RunSvelteKitCommand execute the relative npmClient sveltekit script command as defined on the package.json file.

func (*NPMClient) RunUpdate

func (s *NPMClient) RunUpdate(pmName string, operation string, silentMode bool) error

RunUpdate execute the relative npmClient update command.

type Shell

type Shell interface {
	Execute(string, string, bool) error
	BackgroundExecute(context.Context, string, string, string) ([]byte, error)
}

Shell is the interface defining the methods to be implemented by a shell instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL