context

package
v0.0.0-...-1b94cb7 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 4 Imported by: 0

README

CmdContext

Based off:

type Factory struct {
	Prompter  prompter.Prompter
    ...
	Remotes    func() (context.Remotes, error)
	Config     func() (config.Config, error)
	Branch     func() (string, error)
	...
	ExtensionManager extensions.ExtensionManager
	ExecutableName   string
}

// Executable is the path to the currently invoked binary
func (f *Factory) Executable() string {
	if !strings.ContainsRune(f.ExecutableName, os.PathSeparator) {
		f.ExecutableName = executable(f.ExecutableName)
	}
	return f.ExecutableName
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGlobalPluginsDir

func GetGlobalPluginsDir(runtimeOS string) string

Following the terraform scheme for specifying a plugins directory: Windows: %APPDATA%\.terraform.d\plugins -> %APPDATA%\.create-fullstack\plugins Mac OS/Linux: $HOME/.create-fullstack/plugins

Types

type CmdContext

type CmdContext struct {
	Logger *zap.Logger
	CliUi  *cliui.ColorUi

	Version        string
	BuildDate      string
	ExecutableName string

	GlobalPluginsDir string // the parent dir storing all plugins directories
}

Contains the shared parameters that all commands need access to.

Jump to

Keyboard shortcuts

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