fix: ghostty-capture: double check if the correct filepath is given
This commit is contained in:
@@ -25,11 +25,19 @@ file=${1:-$(wl-paste --no-newline)}
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -e "$file" ] || {
|
[ -f "$file" ] || {
|
||||||
echo "File does not exist: $file" >&2
|
echo "File does not exist: $file" >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "$file" in
|
||||||
|
/tmp/*/*.txt) ;;
|
||||||
|
*)
|
||||||
|
echo "Possibily not a Ghostty generated temp file: $file" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
${EDITOR:-vim} "$file"
|
${EDITOR:-vim} "$file"
|
||||||
|
|
||||||
rm -f "$file"
|
rm -f "$file"
|
||||||
|
|||||||
Reference in New Issue
Block a user