sscommon

package
v0.0.0-...-7426b64 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanRcFile

func CleanRcFile(path string, data RcIdentification) error

func EnvSlice

func EnvSlice(env map[string]string) []string

EnvSlice

func EscapeEnv

func EscapeEnv(env map[string]string) map[string]string

EscapeEnv escapes all values so they can be exported

func NewCommand

func NewCommand(command string, args []string, env []string) *exec.Cmd

func RemoveLegacyInstallPath

func RemoveLegacyInstallPath(path string) error

RemoveLegacyInstallPath removes the PATH modification statement added to the shell-rc file by the legacy install script

func SetupProjectRcFile

func SetupProjectRcFile(prj *project.Project, templateName, ext string, env map[string]string, out output.Outputer, cfg Configurable, bashifyPaths bool) (*os.File, error)

SetupProjectRcFile creates a temporary RC file that our shell is initiated from, this allows us to template the logic used for initialising the subshell

func SetupShellRcFile

func SetupShellRcFile(rcFileName, templateName string, env map[string]string, namespace *project.Namespaced, cfg Configurable) error

SetupShellRcFile create a rc file to activate a runtime (without a project being present)

func Start

func Start(cmd *exec.Cmd) chan error

Start wires stdin/stdout/stderr into the provided command, starts it, and returns a channel to monitor errors on.

func Stop

func Stop(cmd *exec.Cmd) error

Stop signals the provided command to terminate.

func WriteRcData

func WriteRcData(data string, path string, identification RcIdentification) error

func WriteRcFile

func WriteRcFile(rcTemplateName string, path string, data RcIdentification, env map[string]string) error

Types

type Configurable

type Configurable interface {
	Set(string, interface{}) error
	GetBool(string) bool
	GetString(string) string
	GetStringMap(string) map[string]interface{}
}

Configurable defines an interface to store and get configuration data

type RunFunc

type RunFunc func(env []string, name string, args ...string) error

RunFunc ...

func RunFuncByBinary

func RunFuncByBinary(binary string) RunFunc

Jump to

Keyboard shortcuts

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