Documentation ¶
Overview ¶
Package alias sets up the shell alias for Granted. The alias is required so that the Granted wrapper script (scripts/granted in this repository) is sourced rather than executed. By sourcing the wrapper script we can export environment variables into the user's shell after they call the Granted CLI. These variables are typically used for cloud provider session credentials.
Index ¶
- func GetDefaultAlias() string
- func GetFishAlias() string
- func Install(shell string) error
- func IsConfigured() bool
- func IsSupported(shell string) bool
- func MustBeConfigured() error
- func Require(cmd *cli.Command) *cli.Command
- func Uninstall(shell string) error
- type Config
- type ErrAlreadyInstalled
- type ErrNotInstalled
- type ErrShellNotSupported
- type SetupShellResults
- type UninstallShellResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultAlias ¶
func GetDefaultAlias() string
func GetFishAlias ¶
func GetFishAlias() string
func IsConfigured ¶
func IsConfigured() bool
IsConfigured returns whether the shell alias is correctly set up for Granted.
func IsSupported ¶
IsSupported returns true if Granted supports configuring aliases automatically for a user's shell
func MustBeConfigured ¶
func MustBeConfigured() error
MustBeConfigured displays a helpful error message and exits the CLI if the alias is detected as not being configured properly.
Types ¶
type ErrAlreadyInstalled ¶
type ErrAlreadyInstalled struct {
File string
}
func (*ErrAlreadyInstalled) Error ¶
func (e *ErrAlreadyInstalled) Error() string
type ErrNotInstalled ¶
type ErrNotInstalled struct {
File string
}
func (*ErrNotInstalled) Error ¶
func (e *ErrNotInstalled) Error() string
type ErrShellNotSupported ¶
type ErrShellNotSupported struct {
Shell string
}
func (*ErrShellNotSupported) Error ¶
func (e *ErrShellNotSupported) Error() string
type SetupShellResults ¶
type SetupShellResults struct {
ConfigFile string
}
func SetupShellWizard ¶
func SetupShellWizard() (*SetupShellResults, error)
type UninstallShellResults ¶
type UninstallShellResults struct {
ConfigFile string
}
func UninstallDefaultShellAlias ¶
func UninstallDefaultShellAlias() (*UninstallShellResults, error)
UninstallDefaultShellAlias tries to uninstall the Granted aliases from the user's default shell bindings