diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-21 17:29:54 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-21 17:29:54 +0200 |
commit | 3a0713ce08f14525e1cb5e645cf411a07d6ccb19 (patch) | |
tree | b953aae4c21faeefe6399ec6e9b65b7554f9dac1 /pkgs/by-name/ll | |
parent | fix(pkgs/iamb): Temporarily include as pkg (diff) | |
download | nixos-config-3a0713ce08f14525e1cb5e645cf411a07d6ccb19.tar.gz nixos-config-3a0713ce08f14525e1cb5e645cf411a07d6ccb19.zip |
fix(pkgs/ll): Ensure that the last_directory save dir exists
Diffstat (limited to 'pkgs/by-name/ll')
-rwxr-xr-x | pkgs/by-name/ll/ll/ll.sh | 1 | ||||
-rwxr-xr-x | pkgs/by-name/ll/lm/lm.sh | 12 | ||||
-rw-r--r-- | pkgs/by-name/ll/lm/package.nix | 9 |
3 files changed, 1 insertions, 21 deletions
diff --git a/pkgs/by-name/ll/ll/ll.sh b/pkgs/by-name/ll/ll/ll.sh index 9bec7eaf..73328e3e 100755 --- a/pkgs/by-name/ll/ll/ll.sh +++ b/pkgs/by-name/ll/ll/ll.sh @@ -9,6 +9,7 @@ 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!" diff --git a/pkgs/by-name/ll/lm/lm.sh b/pkgs/by-name/ll/lm/lm.sh deleted file mode 100755 index 55be0798..00000000 --- a/pkgs/by-name/ll/lm/lm.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -if [ -f "$XDG_RUNTIME_DIR/ll/last_directory" ]; then - last_dir="$(cat "$XDG_RUNTIME_DIR/ll/last_directory")" - cd "$last_dir" || die "$last_dir does not exist!" -else - msg "No last directory safed (try using ll instead)." -fi -# vim: ft=sh diff --git a/pkgs/by-name/ll/lm/package.nix b/pkgs/by-name/ll/lm/package.nix deleted file mode 100644 index ef417cd2..00000000 --- a/pkgs/by-name/ll/lm/package.nix +++ /dev/null @@ -1,9 +0,0 @@ -{sysLib}: -sysLib.writeShellScript { - name = "lm"; - src = ./lm.sh; - generateCompletions = false; - - # `ll` must be able to change the path of the running shell. - wrap = false; -} |