2024-03-16 13:36:24 -05:00
|
|
|
#!/usr/bin/env -S nix --extra-experimental-features "flakes nix-command" shell nixpkgs#bash nixpkgs#git --command bash
|
2024-03-16 11:59:29 -05:00
|
|
|
# vim: ft=sh
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
main() {
|
|
|
|
local root
|
|
|
|
root="$(git rev-parse --show-toplevel)"
|
|
|
|
|
|
|
|
local files=()
|
|
|
|
|
|
|
|
while IFS= read -r file; do
|
|
|
|
local fpath="${root}/${file}"
|
|
|
|
if [[ -r "${fpath}" ]]; then
|
|
|
|
files+=("${fpath}")
|
|
|
|
fi
|
|
|
|
done < <(git ls-tree --full-name --full-tree --name-only -r HEAD)
|
|
|
|
|
2024-03-16 14:59:19 -05:00
|
|
|
Fmt -- "${files[@]}"
|
2024-03-16 11:59:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
main "${@}"
|