浏览代码

feat(plugins): Plugin "debian": Switch order of "apt" and "aptitude" for detection (#7533)

* Switch order of "apt" and "aptitude" for detection

"apt" is installed by default at Debian (maybe Ubuntu too), while "aptitude" does not seem to be installed by default.
For that, it may be better for most of the users to prefer "aptitude" if installed.

* plugins/debian/README: Change of order mirroded into documentation
Felix Stupp 2 年之前
父节点
当前提交
26e9cead1a
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 1 1
      plugins/debian/README.md
  2. 5 5
      plugins/debian/debian.plugin.zsh

+ 1 - 1
plugins/debian/README.md

@@ -10,7 +10,7 @@ plugins=(... debian)
 
 
 ## Settings
 ## Settings
 
 
-- `$apt_pref`: use apt or aptitude if installed, fallback is apt-get.
+- `$apt_pref`: use aptitude or apt if installed, fallback is apt-get.
 - `$apt_upgr`: use upgrade or safe-upgrade (for aptitude).
 - `$apt_upgr`: use upgrade or safe-upgrade (for aptitude).
 
 
 Set `$apt_pref` and `$apt_upgr` to whatever command you want (before sourcing Oh My Zsh) to override this behavior.
 Set `$apt_pref` and `$apt_upgr` to whatever command you want (before sourcing Oh My Zsh) to override this behavior.

+ 5 - 5
plugins/debian/debian.plugin.zsh

@@ -1,13 +1,13 @@
-# Use apt or aptitude if installed, fallback is apt-get
+# Use aptitude or apt if installed, fallback is apt-get
 # You can just set apt_pref='apt-get' to override it.
 # You can just set apt_pref='apt-get' to override it.
 
 
 if [[ -z $apt_pref || -z $apt_upgr ]]; then
 if [[ -z $apt_pref || -z $apt_upgr ]]; then
-    if [[ -e $commands[apt] ]]; then
-        apt_pref='apt'
-        apt_upgr='upgrade'
-    elif [[ -e $commands[aptitude] ]]; then
+    if [[ -e $commands[aptitude] ]]; then
         apt_pref='aptitude'
         apt_pref='aptitude'
         apt_upgr='safe-upgrade'
         apt_upgr='safe-upgrade'
+    elif [[ -e $commands[apt] ]]; then
+        apt_pref='apt'
+        apt_upgr='upgrade'
     else
     else
         apt_pref='apt-get'
         apt_pref='apt-get'
         apt_upgr='upgrade'
         apt_upgr='upgrade'