qemush : modification du flot d'exécution de la commande edit
This commit is contained in:
parent
b9b96f6467
commit
c86cbbf089
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue