blob: 463bbaf7c84dc66d7a895e70b353131640dcb3dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/usr/bin/env sh
set -eu #o pipefail
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
if [ -d "$cachedir" ]; then
cache=$cachedir/run_list
else
cache=$HOME/.run_list
fi
#if [ ! -f "$cache" ] || [ $(find "$cache" -mmin +180) = "$cache" ]; then
IFS=':'
if [ ! -f "$cache" ] || [ $(find $PATH -prune -cnewer "$cache" 2>/dev/null |\
head -c1 | wc -c) -eq 1 ]; then
find -L $PATH -maxdepth 1 -type f -executable -printf "%f\n" 2>/dev/null |\
sort -u | tee "$cache"
else
cat "$cache"
fi
|