initial commit
This commit is contained in:
commit
6cef260109
11 changed files with 1960 additions and 0 deletions
35
mew-run
Executable file
35
mew-run
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/sh
|
||||
|
||||
cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
|
||||
cache="$cachedir/mew_run"
|
||||
|
||||
[ -d "$cachedir" ] || mkdir -p "$cachedir"
|
||||
|
||||
uptodate() {
|
||||
[ -f "$cache" ] || return 1
|
||||
IFS=:
|
||||
for path in $PATH; do
|
||||
# non-POSIX
|
||||
test "$path" -nt "$cache" && return 1
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
bins() {
|
||||
IFS=:
|
||||
for path in $PATH; do
|
||||
for bin in "$path"/*; do
|
||||
[ -x "$bin" ] && echo "${bin##*/}"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
path() {
|
||||
if uptodate; then
|
||||
cat "$cache"
|
||||
else
|
||||
bins | sort -u | tee "$cache"
|
||||
fi
|
||||
}
|
||||
|
||||
path | mew "$@" | ${SHELL:-"/bin/sh"} &
|
Loading…
Add table
Add a link
Reference in a new issue