Documentation ¶
Index ¶
- func Child(dir string, file string) (string, bool)
- func FileDisplayName(baseDirs []string, f string) string
- func FileListDisplayNames(baseDirs []string, files []string) []string
- func FormatFileChangeList(changedFiles []string) string
- func IsBrokenSymlink(path string) (bool, error)
- func IsChild(dir string, file string) bool
- func IsChildOfOne(dirs []string, file string) bool
- func IsDir(path string) bool
- func IsRegularFile(path string) bool
- func MustAbs(path string) string
- func RealAbs(path string) (string, error)
- func RealChild(dir string, file string) (string, bool, error)
- func Realwd() (string, error)
- func TryAsCwdChildren(absPaths []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Child ¶
Given absolute paths `dir` and `file`, returns the relative path of `file` relative to `dir`.
Returns true if successful. If `file` is not under `dir`, returns false.
TODO(nick): Should we have an assertion that dir and file are absolute? This is a common mistake when using this API. It won't work correctly with relative paths.
func FileDisplayName ¶ added in v0.7.11
Calculate a display name for a file by figuring it out what basedir it's relative to and trimming the basedir prefix off the front
func FileListDisplayNames ¶ added in v0.7.11
Calculate display name for list of files.
func FormatFileChangeList ¶ added in v0.10.9
func IsBrokenSymlink ¶
func IsChild ¶ added in v0.7.11
IsChildOfOne returns true if the given file is a child of the given directory
func IsChildOfOne ¶ added in v0.7.12
IsChildOfOne returns true if the given file is a child of (at least) one of the given directories.
func IsRegularFile ¶ added in v0.4.1
func TryAsCwdChildren ¶
TryAsCwdChildren converts the given absolute paths to children of the CWD, if possible (otherwise, leaves them as absolute paths).
Types ¶
This section is empty.