From c86cbbf0899589f77bb0931d56fab1b38a8694f4 Mon Sep 17 00:00:00 2001 From: Ahurac Date: Sun, 24 Mar 2024 22:52:57 +0100 Subject: [PATCH] =?UTF-8?q?qemush=20:=20modification=20du=20flot=20d'ex?= =?UTF-8?q?=C3=A9cution=20de=20la=20commande=20edit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/qemush | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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