github.com/go-task/task/v3/internal/fsext
No package summary is available.
Package
Files: 1. Third party imports: 0. Imports from organisation: 0. Tests: 0. Benchmarks: 0.
Functions
func DefaultDir
DefaultDir will return the default directory given an entrypoint or directory. If the directory is set, it will ensure it is an absolute path and return it. If the entrypoint is set, but the directory is not, it will leave the directory blank. If both are empty, it will default the directory to the current working directory.
Uses: filepath.Abs, os.Getwd.func Search
Search will look for files with the given possible filenames using the given entrypoint and directory. If the entrypoint is set, it will check if the entrypoint matches a file or if it matches a directory containing one of the possible filenames. Otherwise, it will walk up the file tree starting at the given directory and perform a search in each directory for the possible filenames until it finds a match or reaches the root directory. If the entrypoint and directory are both empty, it will default the directory to the current working directory and perform a recursive search starting there. If a match is found, the absolute path to the file will be returned with its directory. If no match is found, an error will be returned.
Uses: filepath.Abs, filepath.Dir, os.Getwd.func SearchPath
Search will check if a file at the given path exists or not. If it does, it will return the path to it. If it does not, it will search for any files at the given path with any of the given possible names. If any of these match a file, the first matching path will be returned. If no files are found, an error will be returned.
Uses: filepath.Abs, filepathext.SmartJoin, os.ErrNotExist, os.ModeDevice, os.ModeNamedPipe, os.ModeSymlink, os.Stat.func SearchPathRecursively
SearchRecursively will check if a file at the given path exists by calling the exists function. If a file is not found, it will walk up the directory tree calling the Search function until it finds a file or reaches the root directory. On supported operating systems, it will also check if the user ID of the directory changes and abort if it does.
Uses: filepath.Dir, os.ErrNotExist, sysinfo.Owner.Tests
Files: 1. Third party imports: 1. Imports from organisation: 0. Tests: 2. Benchmarks: 0.