Documentation
¶
Index ¶
- type BashShell
- func (shell *BashShell) ChangeEnvironment(sanicEnvironment string) error
- func (shell *BashShell) Enter() error
- func (shell *BashShell) Exec(requestedCommand []string) (errorCode int, err error)
- func (shell *BashShell) GetSanicConfig() string
- func (shell *BashShell) GetSanicEnvironment() string
- func (shell *BashShell) GetSanicRoot() string
- func (shell *BashShell) ShellExec(requestedCommand string, args []string) (errorCode int, err error)
- type Shell
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BashShell ¶
type BashShell struct {
Path string //e.g., /bin/bash
// contains filtered or unexported fields
}
BashShell represents a bash environment which maintains sanic's environment variables
func (*BashShell) ChangeEnvironment ¶
ChangeEnvironment changes the currently entered shell's sanic environment to a new one
func (*BashShell) Enter ¶
Enter : execvp the current process into a new sanic shell. Note: Does not return.
func (*BashShell) GetSanicConfig ¶
GetSanicConfig returns the current path to the sanic configuration file
func (*BashShell) GetSanicEnvironment ¶
GetSanicEnvironment returns the current environment (e.g., "sanic env dev" -> dev)
func (*BashShell) GetSanicRoot ¶
GetSanicRoot returns the current path to the project root directory
type Shell ¶
type Shell interface {
//Enter this specific shell.
//If not already in a sanic env, this will execp a new shell
//If already in a sanic env, this will change the current shell's variables
//In both cases, only returns with an error, otherwise execution is terminated
Enter() error
//Execute the given command in this shell
Exec(requestedCommand []string) (errorCode int, err error)
//Execute the given command in "Shell mode", i.e., allowing spaces
ShellExec(requestedCommand string, args []string) (errorCode int, err error)
//If "sanic env dev", return "dev"
GetSanicEnvironment() string
//return absolute path to the current shell's sanic project's root
GetSanicRoot() string
//return absolute path to the current shell's sanic project's config
GetSanicConfig() string
//must already be in an environment, this changes the current shell's environment to a new one
ChangeEnvironment(sanicEnvironment string) error
}
Shell represents, broadly, the current shell environment we're in (by having executed sanic env) it keeps track of terminal state and allows executing commands.