Documentation
¶
Index ¶
- func AbsPath(path string) string
- func DeterminePath(configPath string, keyPath string) string
- func ExecuteWithInput(exe, text string, args ...string) (string, error)
- func ExecuteWithInputEnv(exe, text string, env []string, args ...string) (string, error)
- func FileExists(filename string) bool
- func FileNameWithoutExt(fileName string) string
- func IsDir(filename string) bool
- func IsLinux() bool
- func IsMac() bool
- func IsUnix() bool
- func IsWindows() bool
- func Mkdir(dir string) error
- func Name() string
- func NormalizePath(path string) string
- func PlatformAndArch() string
- func RelInside(base, path string) (string, bool)
- func Unarchive(src, dest string) error
- func Walk(path string, walkFn filepath.WalkFunc) error
- func Which(cmds []string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeterminePath ¶
DeterminePath determines the path of `keyPath` based on `configPath`.
If `keyPath` is an absolute path, it is returned as is.
If `keyPath` is a relative path, it is joined with `configPath`.
If `configPath` is not a directory, the directory part of `configPath` is used.
func ExecuteWithInput ¶
ExecuteWithInput runs a command with the given text as input.
func ExecuteWithInputEnv ¶ added in v3.23.0
ExecuteWithInputEnv is ExecuteWithInput with variables added to the command's environment.
func FileExists ¶
FileExists determines if the path given by `filename` exists.
func FileNameWithoutExt ¶
FileNameWithoutExt returns the filename without its extension.
func NormalizePath ¶
NormalizePath expands a tilde and returns the absolute path of `path`.
func PlatformAndArch ¶
func PlatformAndArch() string
PlatformAndArch returns the current platform and architecture.
func RelInside ¶ added in v3.25.0
RelInside returns path relative to base when it lies inside base. A path outside base, or one that can't be made relative, is returned as given with false.
Types ¶
This section is empty.