From 915f19f1422ece6440db80fcd61fc9c547039f8d Mon Sep 17 00:00:00 2001 From: Uyanide Date: Fri, 28 Nov 2025 10:53:51 +0100 Subject: [PATCH] fix: ghostty-capture: double check if the correct filepath is given --- config/scripts/.local/scripts/ghostty-capture | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/scripts/.local/scripts/ghostty-capture b/config/scripts/.local/scripts/ghostty-capture index de7929f..f64cee5 100755 --- a/config/scripts/.local/scripts/ghostty-capture +++ b/config/scripts/.local/scripts/ghostty-capture @@ -25,11 +25,19 @@ file=${1:-$(wl-paste --no-newline)} exit 1 } -[ -e "$file" ] || { +[ -f "$file" ] || { echo "File does not exist: $file" >&2 exit 1 } +case "$file" in + /tmp/*/*.txt) ;; + *) + echo "Possibily not a Ghostty generated temp file: $file" >&2 + exit 1 + ;; +esac + ${EDITOR:-vim} "$file" rm -f "$file"