sh

package
v0.7.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Bash = "bash"
	Zsh  = "zsh"
	Fish = "fish"
)
View Source
const (
	ModePerm         fs.FileMode = 0o644
	VMDisableEnvName string      = "VM_DISABLE"
	VMEnvFileName    string      = "vmr"
)

Variables

View Source
var ShellRegExp = regexp.MustCompile(`# cd hook start[\w\W]+# cd hook end`)

Update vmr.sh or vmr.fish

Functions

func FormatPathString

func FormatPathString(p string) (formattedPath string)

func UpdateVMRShellFile added in v0.6.3

func UpdateVMRShellFile(fPath, vmrPathEnv, newHookContent string)

Types

type BashShell

type BashShell struct{}

func NewBashShell

func NewBashShell() *BashShell

func (*BashShell) ConfPath

func (b *BashShell) ConfPath() string

func (*BashShell) PackEnv

func (b *BashShell) PackEnv(key, value string) string

func (*BashShell) PackPath

func (b *BashShell) PackPath(path string) string

func (*BashShell) VMEnvConfPath

func (b *BashShell) VMEnvConfPath() string

func (*BashShell) WriteVMEnvToShell

func (b *BashShell) WriteVMEnvToShell()

type FishShell

type FishShell struct{}

func NewFishShell

func NewFishShell() *FishShell

func (*FishShell) ConfPath

func (f *FishShell) ConfPath() string

func (*FishShell) PackEnv

func (f *FishShell) PackEnv(key, value string) string

func (*FishShell) PackPath

func (f *FishShell) PackPath(path string) string

func (*FishShell) VMEnvConfPath

func (f *FishShell) VMEnvConfPath() string

func (*FishShell) WriteVMEnvToShell

func (f *FishShell) WriteVMEnvToShell()

type Sheller

type Sheller interface {
	ConfPath() string
	VMEnvConfPath() string
	WriteVMEnvToShell()
	PackPath(path string) string
	PackEnv(key, value string) string
}

type ZshShell

type ZshShell struct{}

func NewZshShell

func NewZshShell() *ZshShell

func (*ZshShell) ConfPath

func (z *ZshShell) ConfPath() string

func (*ZshShell) PackEnv

func (z *ZshShell) PackEnv(key, value string) string

func (*ZshShell) PackPath

func (z *ZshShell) PackPath(path string) string

func (*ZshShell) VMEnvConfPath

func (z *ZshShell) VMEnvConfPath() string

func (*ZshShell) WriteVMEnvToShell

func (z *ZshShell) WriteVMEnvToShell()

Jump to

Keyboard shortcuts

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