exec

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRepos

func CloneRepos(config *dao.Config, projects []dao.Project, syncFlags core.SyncFlags) error

func ExecTTY added in v0.30.0

func ExecTTY(cmd string, envs []string) error

func PrintProjectInit

func PrintProjectInit(projects []dao.Project)

func PrintProjectStatus

func PrintProjectStatus(config *dao.Config, projects []dao.Project) error

func RunTableCmd

func RunTableCmd(t TableCmd, data dao.TableOutput, dataMutex *sync.RWMutex, wg *sync.WaitGroup) error

func RunTextCmd

func RunTextCmd(
	t TableCmd,
	textStyle dao.Stream,
	prefix string,
	parallel bool,
	wg *sync.WaitGroup,
	stdout io.Writer,
	stderr io.Writer,
) error

func UpdateGitignoreIfExists

func UpdateGitignoreIfExists(config *dao.Config) error

Types

type Client

type Client struct {
	Name string
	Path string
	Env  []string
	// contains filtered or unexported fields
}

Client is a wrapper over the SSH connection/sessions.

func (*Client) Close

func (c *Client) Close() error

func (*Client) Prefix

func (c *Client) Prefix() string

func (*Client) Run

func (c *Client) Run(shell string, env []string, cmdStr []string) error

func (*Client) Stderr

func (c *Client) Stderr() io.Reader

func (*Client) Stdout

func (c *Client) Stdout() io.Reader

func (*Client) Wait

func (c *Client) Wait() error

type Exec

type Exec struct {
	Clients  []Client
	Projects []dao.Project
	Tasks    []dao.Task
	Config   dao.Config
}

func (*Exec) CheckTaskNoColor

func (e *Exec) CheckTaskNoColor()

func (*Exec) ParseTask

func (exec *Exec) ParseTask(userArgs []string, runFlags *core.RunFlags, setRunFlags *core.SetRunFlags) error

ParseTask processes and updates task configurations based on runtime flags and user arguments. It handles theme, specification, environment variables, and execution settings for each task.

The function performs these operations for each task: 1. Evaluates configuration environment variables 2. Updates theme if specified 3. Updates spec settings if provided 4. Applies runtime execution flags 5. Processes environment variables for the task and its commands

Environment variable processing order: 1. Configuration level variables 2. Task level variables 3. Command level variables 4. User provided arguments

func (*Exec) Run

func (exec *Exec) Run(
	userArgs []string,
	runFlags *core.RunFlags,
	setRunFlags *core.SetRunFlags,
) error

func (*Exec) RunTUI added in v0.30.0

func (exec *Exec) RunTUI(
	userArgs []string,
	runFlags *core.RunFlags,
	setRunFlags *core.SetRunFlags,
	output string,
	outWriter io.Writer,
	errWriter io.Writer,
) error

func (*Exec) SetClients

func (exec *Exec) SetClients(
	clientCh chan Client,
	errCh chan error,
) error

func (*Exec) SetCloneClients

func (exec *Exec) SetCloneClients(clientCh chan Client) error

func (*Exec) Table

func (exec *Exec) Table(runFlags *core.RunFlags) dao.TableOutput

func (*Exec) TableWork

func (exec *Exec) TableWork(rIndex int, dryRun bool, data dao.TableOutput, dataMutex *sync.RWMutex) error

func (*Exec) Text

func (exec *Exec) Text(
	dryRun bool,
	stdout io.Writer,
	stderr io.Writer,
)

func (*Exec) TextWork

func (exec *Exec) TextWork(
	rIndex int,
	prefixMaxLen int,
	dryRun bool,
	stdout io.Writer,
	stderr io.Writer,
) error

type TableCmd

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳