qemush : modification du flot d'exécution de la commande edit

This commit is contained in:
Ahurac 2024-03-24 22:52:57 +01:00
parent b9b96f6467
commit c86cbbf089

View file

@ -113,14 +113,16 @@ public_diskls() {
# Edit a virtual machine entrypoint with a text editor # Edit a virtual machine entrypoint with a text editor
public_edit() { public_edit() {
cd || return
local file="launchers/${1}" local file="launchers/${1}"
# I don't even know why shellcheck gives me this warning # I don't even know why shellcheck gives me this warning
# shellcheck disable=2209 # shellcheck disable=2209
[ -z "$EDITOR" ] && EDITOR=vi [ -z "$EDITOR" ] && EDITOR=vi
"$EDITOR" "$file" set -e
[ -f "$file" ] && exec chmod u+x "$file" cd
touch -- "$file"
chmod u+x -- "$file"
exec "$EDITOR" -- "$file"
} }
# Delete a virtual machine entrypoint # Delete a virtual machine entrypoint