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