Bob Mottram 6 lat temu
rodzic
commit
fcb209d3a9
1 zmienionych plików z 24 dodań i 29 usunięć
  1. 24
    29
      src/freedombone-addremove

+ 24
- 29
src/freedombone-addremove Wyświetl plik

@@ -108,19 +108,17 @@ function show_apps {
108 108
     # shellcheck disable=SC2068
109 109
     for a in ${APPS_AVAILABLE[@]}
110 110
     do
111
-        if [[ $(app_not_on_onion_only "$a") != "0" ]]; then
112
-            if [[ ${APPS_INSTALLED[$app_index]} == "0" &&  "$select_all_apps" != "add-all" ]]; then
111
+        if [[ ${APPS_INSTALLED[$app_index]} == "0" &&  "$select_all_apps" != "add-all" ]]; then
112
+            applist="$applist $n $a off"
113
+        else
114
+            if [[ $(app_expected_to_be_installed "$select_all_apps" "$a") == "0" ]]; then
113 115
                 applist="$applist $n $a off"
114 116
             else
115
-                if [[ $(app_expected_to_be_installed "$select_all_apps" "$a") == "0" ]]; then
116
-                    applist="$applist $n $a off"
117
-                else
118
-                    applist="$applist $n $a on"
119
-                fi
117
+                applist="$applist $n $a on"
120 118
             fi
121
-            n=$((n+1))
122
-            app_index=$((app_index+1))
123 119
         fi
120
+        n=$((n+1))
121
+        app_index=$((app_index+1))
124 122
     done
125 123
 
126 124
     # shellcheck disable=SC2086
@@ -149,19 +147,17 @@ function remove_apps_selected {
149 147
     # shellcheck disable=SC2068
150 148
     for a in ${APPS_INSTALLED[@]}
151 149
     do
152
-        if [[ $(app_not_on_onion_only "$a") != "0" ]]; then
153
-            if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
154
-                if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
155
-                    if [ ${n} -gt 0 ]; then
156
-                        removals="$removals ${APPS_AVAILABLE[$app_index]}"
157
-                    else
158
-                        removals="${APPS_AVAILABLE[$app_index]}"
159
-                    fi
160
-                    n=$((n+1))
150
+        if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
151
+            if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
152
+                if [ ${n} -gt 0 ]; then
153
+                    removals="$removals ${APPS_AVAILABLE[$app_index]}"
154
+                else
155
+                    removals="${APPS_AVAILABLE[$app_index]}"
161 156
                 fi
157
+                n=$((n+1))
162 158
             fi
163
-            app_index=$((app_index+1))
164 159
         fi
160
+        app_index=$((app_index+1))
165 161
     done
166 162
 
167 163
     # if no apps to be removed then don't do anything
@@ -196,19 +192,18 @@ function install_apps_selected {
196 192
     # shellcheck disable=SC2068
197 193
     for a in ${APPS_INSTALLED[@]}
198 194
     do
199
-        if [[ $(app_not_on_onion_only "$a") != "0" ]]; then
200
-            if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
201
-                if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
202
-                    if [ ${n} -gt 0 ]; then
203
-                        installs="$installs ${APPS_AVAILABLE[$app_index]}"
204
-                    else
205
-                        installs="${APPS_AVAILABLE[$app_index]}"
206
-                    fi
207
-                    n=$((n+1))
195
+        if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
196
+            if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
197
+                if [ ${n} -gt 0 ]; then
198
+                    installs="$installs ${APPS_AVAILABLE[$app_index]}"
199
+                else
200
+                    installs="${APPS_AVAILABLE[$app_index]}"
208 201
                 fi
202
+                n=$((n+1))
209 203
             fi
210
-            app_index=$((app_index+1))
211 204
         fi
205
+        app_index=$((app_index+1))
206
+
212 207
     done
213 208
 
214 209
     # if no apps to be installed then don't do anything