]> Sergey Matveev's repositories - nnn.git/commitdiff
Change command order
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 15 Jan 2020 11:48:10 +0000 (17:18 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 15 Jan 2020 11:48:10 +0000 (17:18 +0530)
plugins/suedit

index 7ba00db1b47cca3f74bad36251735b3cacf4defe..7598525b361f9e9fc23772cd6827ad33bbfb37ec 100755 (executable)
@@ -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