Improve edit script

This commit is contained in:
Tobias Reisinger 2022-04-06 23:51:53 +02:00
parent 19fdac4137
commit b8dd204681
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE

View file

@ -20,6 +20,8 @@ echo "Editing $1 in $filepath as $user:$group"
sudo test -e "$1" && (
sudo cp -i "$1" "$filepath"
sudo chown "$user":"$group" "$filepath"
) || (
touch "$filepath"
)
$EDITOR "$filepath"