Documentation
¶
Index ¶
- func AbsPath(path string) string
- func DeterminePath(configPath string, keyPath string) string
- 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 ReplaceFileExt(fp string, formats map[string]string) string
- 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 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 ReplaceFileExt ¶
ReplaceExt replaces the extension of `fp` with `ext` if the extension of `fp` is in `formats`.
This is used in places where we need to normalize file extensions (e.g., `foo.mdx` -> `foo.md`) in order to respect format associations.
Types ¶
This section is empty.