From 08e00b05f60b7ff3c0385f2249d79c971e1ede10 Mon Sep 17 00:00:00 2001 From: "Lockszmith (VAST@MacBook)" Date: Wed, 30 Apr 2025 10:07:53 -0400 Subject: [PATCH] fix: zellij cleanup when TMPDIR is used --- .../_home/private_dot_local/bin/executable_load-zellij | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chezmoi.roots/_home/private_dot_local/bin/executable_load-zellij b/chezmoi.roots/_home/private_dot_local/bin/executable_load-zellij index 6802fee..1286afb 100644 --- a/chezmoi.roots/_home/private_dot_local/bin/executable_load-zellij +++ b/chezmoi.roots/_home/private_dot_local/bin/executable_load-zellij @@ -20,7 +20,7 @@ if is_sourced; then && ${SUDO:-} rm -fR "$HOME/.cache/zellij" [[ -d "$HOME/Library/Caches/org.Zellij-Contributors.Zellij" ]] \ && ${SUDO:-} rm -fR "$HOME/Library/Caches/org.Zellij-Contributors.Zellij" - find /tmp -maxdepth 1 -mindepth 1 -type d -name 'zellij*' -print0 | ${SUDO:-} xargs -r0t rm -fR + find ${TMPDIR:-/tmp} -maxdepth 1 -mindepth 1 -type d -name 'zellij*' -print0 | ${SUDO:-} xargs -r0t rm -fR if [[ -d "$HOME/.cache/zellij" || -d "$HOME/Library/Caches/org.Zellij-Contributors.Zellij" ]]; then printf 'Zellij cleanup failed to remove the cache directory, you might still have a zellij session active.\n' else @@ -33,10 +33,10 @@ ${SET_X-:} -x local bin_path=~/.local/bin/zellij local cached_path=~/.cache/chezmoi/tmp/zellij if [ -z "$(command -v zellij)" ] && [ -x "${cached_path}" ]; then - printf "Grabbing zellij from the web!\n" + printf "Grabbing zellij from the cache!\n" cp "${cached_path}" "${bin_path}" fi - local cached_path=/tmp/zellij/bootstrap/zellij + local cached_path=${TMPDIR:-/tmp}/zellij/bootstrap/zellij if [ -z "$(env which zellij)" ] && ! [ -x "${bin_path}" ]; then if [[ ! -r "${cached_path}" ]]; then printf "Grabbing zellij from the web!\n" @@ -44,7 +44,7 @@ ${SET_X-:} -x fi if [[ -r "${cached_path}" ]]; then mv "${cached_path}" "${bin_path}" - rm -fR /tmp/zellij + rm -fR ${TMPDIR:-/tmp}/zellij fi fi refresh-zellij() { :; }