pkg

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BashShell = "Bash"
	ZshShell  = "Zsh"
	FishShell = "Fish"

	SkipEditorMode   = "Skip"
	SameEditorMode   = "Same"
	UniqueEditorMode = "Unique"
)

Variables

This section is empty.

Functions

func AliasFilePath

func AliasFilePath() (string, error)

func AppendToFile added in v0.11.0

func AppendToFile(afs afero.Fs, path string, data []byte) error

func ConfigDirPath

func ConfigDirPath() (string, error)

func ConfigFileMissing

func ConfigFileMissing(appFs afero.Fs) (bool, error)

func ConfigFilePath

func ConfigFilePath() (string, error)

func ExpandPath added in v1.1.0

func ExpandPath(path string) (string, error)

func FileMissing added in v0.5.0

func FileMissing(fs afero.Fs, path string) bool

func MakeConfigDir

func MakeConfigDir(fs afero.Fs) error

func ReadFile added in v0.5.0

func ReadFile(afs afero.Fs, path string) ([]byte, error)

func RemoveFile added in v0.8.0

func RemoveFile(afs afero.Fs, path string) error

func SaveAliases added in v0.13.0

func SaveAliases(appFs afero.Fs, aliases []Alias) error

func SaveExtraDir

func SaveExtraDir(appFs afero.Fs, path string) error

func WriteFile added in v0.6.0

func WriteFile(afs afero.Fs, fileName string, data []byte, perm fs.FileMode) error

func WriteFixtureFile added in v0.13.0

func WriteFixtureFile(t *testing.T, appFs afero.Fs, path string, data []byte)

Types

type Alias added in v0.13.0

type Alias struct {
	// contains filtered or unexported fields
}

func NewAlias added in v0.13.0

func NewAlias(alias string, path string, editorCmd string) Alias

func (*Alias) String added in v0.13.0

func (a *Alias) String() string

type Config

type Config struct {
	Path       string
	Editormode string
	Editorcmd  string
	Shell      string
	Extras     []string
}

func FromJson

func FromJson(j []byte) (Config, error)

func NewConfig added in v0.13.0

func NewConfig(path string, editorMode string, editorCmd string, shell string) (Config, error)

func ReadConfigFile

func ReadConfigFile(appFs afero.Fs) (Config, error)

func (Config) AsJson

func (c Config) AsJson() ([]byte, error)

func (*Config) Save

func (c *Config) Save(appFs afero.Fs) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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