diff options
Diffstat (limited to '')
| -rwxr-xr-x | modules/by-name/lf/lf/wrappers/ll/ll.sh | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/modules/by-name/lf/lf/wrappers/ll/ll.sh b/modules/by-name/lf/lf/wrappers/ll/ll.sh index ce29fd97..9bb314c6 100755 --- a/modules/by-name/lf/lf/wrappers/ll/ll.sh +++ b/modules/by-name/lf/lf/wrappers/ll/ll.sh @@ -10,20 +10,14 @@ # You should have received a copy of the License along with this program. # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -last_directory="$(mktemp -t ll_last_directory_XXXXXXX)" -cleanup() { - rm "$last_directory" -} -trap cleanup EXIT +[ -d "$XDG_RUNTIME_DIR/ll" ] || mkdir "$XDG_RUNTIME_DIR/ll" +last_directory="$XDG_RUNTIME_DIR/ll/last_directory" command lf -last-dir-path="$last_directory" "$@" dir="$(cat "$last_directory")" -if cd "$dir"; then - [ -d "$XDG_RUNTIME_DIR/ll" ] || mkdir "$XDG_RUNTIME_DIR/ll" - echo "$dir" >"$XDG_RUNTIME_DIR/ll/last_directory" -else - die "$dir does not exist!" +if ! cd "$dir"; then + die "ll: Failed to cd to '$dir'. Does it exist?" fi # vim: ft=sh |
