2022-04-18 00:14:34 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
lf () {
|
|
|
|
tmp="$(mktemp)"
|
2022-05-21 09:43:01 +01:00
|
|
|
|
|
|
|
logpath="${LOG_HOME}/lf.log"
|
2022-04-18 00:14:34 +01:00
|
|
|
|
2022-05-21 09:43:01 +01:00
|
|
|
command lf --last-dir-path="$tmp" --log="$logpath" "$@"
|
2022-04-18 00:14:34 +01:00
|
|
|
if [ -f "$tmp" ]; then
|
|
|
|
dir="$(cat "$tmp")"
|
|
|
|
rm -f "$tmp"
|
|
|
|
if [ -d "$dir" ]; then
|
|
|
|
if [ "$dir" != "$(pwd)" ]; then
|
|
|
|
cd "$dir"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|