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
|
# 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
|
||||||
|
|
Loading…
Reference in a new issue