fix: ghostty-capture: double check if the correct filepath is given

This commit is contained in:
2025-11-28 10:53:51 +01:00
parent 94bb499764
commit 915f19f142

View File

@@ -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"