diff options
| author | Riley Beckett <rbeckettvt@gmail.com> | 2025-10-20 17:12:32 -0400 |
|---|---|---|
| committer | Riley Beckett <rbeckettvt@gmail.com> | 2025-10-20 17:13:25 -0400 |
| commit | d39eee7a5e6f66289f91c0519f92203dd1b7469e (patch) | |
| tree | 448ea0e666eb175a9457a975bad4fd415285e45e /swenu-path | |
| parent | 024cee7e848ff8550a52db0667f26a53c54d5478 (diff) | |
generate list of executables and cache faster
Diffstat (limited to 'swenu-path')
| -rwxr-xr-x | swenu-path | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1,6 +1,12 @@ #!/bin/sh -IFS=: -for dir in $PATH; do - [ -e ${dir} ] && find ${dir} -executable -printf '%f\n' -done | sort -u +cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}" +cache="$cachedir/swenu-run" + +[ ! -e "$cachedir" ] && mkdir -p "$cachedir" + +if swenu-exes "$cache"; then + swenu-exes | sort -u | tee $cache +else + cat $cache +fi |
