This commit is contained in:
ducklet 2022-08-14 20:41:58 +02:00
commit 01a96c14d4
18 changed files with 2108 additions and 0 deletions

23
scripts/ls Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh -eu
# Create a `ingest-ls` compatible file listing.
#
# Compatible with current versions of GNU and macOS `ls`.
#
# $ scripts/ls -R /some/base/path \
# | python -m metadex ingest-ls --remove-missing
_ls() {
if command ls -d --time-style='+%s' . >/dev/null 2>&1; then
# echo 'GNU'
command ls --time-style='+%s' "$@"
elif command ls -d -D '%s' . >/dev/null 2>&1; then
# echo 'macOS'
command ls -D '%s' "$@"
else
# echo 'unknown'
command ls "$@"
fi
}
_ls -lnAU "$@"