Documentation
¶
Index ¶
- Variables
- func ClearAllEnv(keeps []string)
- func DecodeFileFlag(flag int) string
- func DecodeFilePerm(perm fs.FileMode) string
- func Gosh(ctx context.Context, vs *VirtualSystem, script string, args []string) error
- func IsCoreUtils(s string) bool
- func IsShell(s string) bool
- func ParseFlags(args []string) (string, string, []string)
- func Run(parent context.Context, vs *VirtualSystem, script string, args []string) error
- func RunCoreUtils(ctx context.Context, vs *VirtualSystem, args []string) (bool, error)
- func VirtualExecHandler(vs *VirtualSystem) func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc
- func VirtualOpenHandler(vs *VirtualSystem) interp.OpenHandlerFunc
- func VirtualReadDirHandler2(vs *VirtualSystem) interp.ReadDirHandlerFunc2
- func VirtualStatHandler(vs *VirtualSystem) interp.StatHandlerFunc
- type ExecHandler
- type IOE
- type StringIOE
- type VirtualSystem
- func (vs *VirtualSystem) NewRunner(opts ...interp.RunnerOption) (*interp.Runner, error)
- func (vs *VirtualSystem) RunInteractive(ctx context.Context) error
- func (vs *VirtualSystem) RunPath(ctx context.Context, path string) error
- func (vs *VirtualSystem) RunReader(ctx context.Context) error
- func (vs *VirtualSystem) RunScript(ctx context.Context, script string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var BuiltinCommands = []string{
"true", "false", "exit", "set", "shift", "unset",
"echo", "printf", "break", "continue", "pwd", "cd",
"wait", "builtin", "trap", "type", "source", ".", "command",
"dirs", "pushd", "popd", "umask", "alias", "unalias",
"fg", "bg", "getopts", "eval", "test", "[", "exec",
"return", "read", "mapfile", "readarray", "shopt",
}
bash commands
View Source
var CoreUtilsCommands = []string{
"base64", "basename", "cat", "chmod", "cp", "date", "dirname", "find", "gzip", "head", "ls", "mkdir",
"mktemp", "mv", "rm", "shasum", "sleep", "tac", "tail", "tar", "time", "touch", "wget", "xargs",
}
internal commands
Functions ¶
func ClearAllEnv ¶ added in v0.0.5
func ClearAllEnv(keeps []string)
ClearAllEnv clears all environment variables except for the keeps
func DecodeFileFlag ¶ added in v0.0.7
func DecodeFilePerm ¶ added in v0.0.7
func Gosh ¶
Gosh executes a script provided in the argument. If no arguments are provided, it will execute in interactive mode if standard input supports it. This function manages errors and exits appropriately.
func IsCoreUtils ¶ added in v0.0.6
func ParseFlags ¶ added in v0.0.7
Parse parses flag definitions from the argument list, which should not include the command name. Return root, script, and remaining non flag args
func RunCoreUtils ¶ added in v0.0.6
func VirtualExecHandler ¶
func VirtualExecHandler(vs *VirtualSystem) func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc
func VirtualOpenHandler ¶
func VirtualOpenHandler(vs *VirtualSystem) interp.OpenHandlerFunc
func VirtualReadDirHandler2 ¶
func VirtualReadDirHandler2(vs *VirtualSystem) interp.ReadDirHandlerFunc2
func VirtualStatHandler ¶
func VirtualStatHandler(vs *VirtualSystem) interp.StatHandlerFunc
Types ¶
type ExecHandler ¶ added in v0.0.3
func NewDummyExecHandler ¶ added in v0.0.3
func NewDummyExecHandler(vs *VirtualSystem) ExecHandler
type StringIOE ¶ added in v0.0.8
type StringIOE struct {
// contains filtered or unexported fields
}
type VirtualSystem ¶
type VirtualSystem struct {
IOE *IOE
// Roots []string
Workspace vfs.Workspace
System vos.System
ExecHandler ExecHandler
MaxTimeout int
}
func NewLocalSystem ¶
func NewLocalSystem(roots []string, ioe *IOE) (*VirtualSystem, error)
func NewVirtualSystem ¶
func (*VirtualSystem) NewRunner ¶ added in v0.0.4
func (vs *VirtualSystem) NewRunner(opts ...interp.RunnerOption) (*interp.Runner, error)
func (*VirtualSystem) RunInteractive ¶ added in v0.0.6
func (vs *VirtualSystem) RunInteractive(ctx context.Context) error
func (*VirtualSystem) RunPath ¶ added in v0.0.4
func (vs *VirtualSystem) RunPath(ctx context.Context, path string) error
Click to show internal directories.
Click to hide internal directories.