wip
This commit is contained in:
commit
01a96c14d4
18 changed files with 2108 additions and 0 deletions
23
scripts/ls
Executable file
23
scripts/ls
Executable 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 "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue