Change command order

This commit is contained in:
Arun Prakash Jana 2020-01-15 17:18:10 +05:30
parent 22454d6893
commit 38de6efd48
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 3 additions and 3 deletions

View File

@ -12,10 +12,10 @@ is_cmd_exists () {
echo $?
}
if [ "$(is_cmd_exists sudoedit)" -eq "0" ]; then
sudoedit "$1"
elif [ "$(is_cmd_exists sudo)" -eq "0" ]; then
if [ "$(is_cmd_exists sudo)" -eq "0" ]; then
sudo "$EDITOR" "$1"
elif [ "$(is_cmd_exists sudoedit)" -eq "0" ]; then
sudoedit "$1"
elif [ "$(is_cmd_exists doas)" -eq "0" ]; then
doas "$EDITOR" "$1"
fi