Crates.io | check-symlinks |
lib.rs | check-symlinks |
version | 0.3.2 |
source | src |
created_at | 2023-05-01 04:57:15.840293 |
updated_at | 2023-05-14 21:22:15.171294 |
description | Check for broken symlinks |
homepage | |
repository | |
max_upload_size | |
id | 853209 |
size | 13,365 |
Check for broken symbolic links.
check-symlinks
is optmized for large codebases as well as small, incremental checks,
where the full commands are respectively,
fd --type symlink --exec sh -c 'test -e "$0"'
check-symlinks
git ls-files | xargs pre_commit_hooks/check_symlinks.py
while read file; do test -e "$test"; done < <(git ls-files)
find . -type l -not -path data ! -exec test -e {} \; -print0 | xargs --no-run-if-empty git ls-files
and check_symlinks.py
is from https://github.com/pre-commit/pre-commit-hooks.
cargo install check-symlinks
By default, checks all unignored files recursively from the current working directory,
$ check-symlinks
"./broken_link" is not a valid symlink
File paths can also be passed,
$ check-symlinks broken_link doesnt_exist
"./broken_link" is not a valid symlink
NOTE: file arguments which don't exist are ignored.