Symlinks
Index¶
symlinks::points_at¶
Predicate: does the given symlink already point at the canonicalized target? True if the link exists AND its canonical resolution equals the canonical resolution of the target.
Arguments¶
- $1 (link): path
- $2 (target): path
Exit codes¶
- 0: if link points at target
- 1: otherwise
symlinks::exists¶
Return true if the given path exists and is a symbolic link.
Arguments¶
- $1 (symlink): path
symlinks::get_target¶
Print the target of a symbolic link; dies if the symlink does not exist. Output: stdout — symlink target path
Arguments¶
- $1 (symlink): path
symlinks::link_file¶
Create a symbolic link from a file to a link path, prompting if the destination already exists. No-ops if the link already points to the correct target.
Arguments¶
- $1 (target): file path
- $2 (link): path to create
symlinks::link_dir¶
Create a symbolic link from a directory to a link path, prompting if the destination already exists. No-ops if the link already points to the correct target.
Arguments¶
- $1 (target): directory path
- $2 (link): path to create