Browse Source

App install logic

Bob Mottram 8 years ago
parent
commit
56df73944e
1 changed files with 15 additions and 12 deletions
  1. 15
    12
      src/freedombone-utils-selector

+ 15
- 12
src/freedombone-utils-selector View File

@@ -283,35 +283,38 @@ function remove_apps {
283 283
 function install_apps {
284 284
     is_interactive=$1
285 285
 
286
-    app_index=0
287
-    for a in "${APPS_AVAILABLE[@]}"
288
-    do
289
-        if [[ $(app_is_removed ${a}) == "0" ]]; then
286
+    # interactive install configuration for each app
287
+    if [ ${is_interactive} ]; then
288
+        app_index=0
289
+        for a in "${APPS_AVAILABLE[@]}"
290
+        do
290 291
             if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
291 292
                 if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
292
-                    if [ ${is_interactive} ]; then
293
-                        # interactively obtain settings for this app
294
-                        if [[ $(function_exists install_interactive_${a}) == "1" ]]; then
295
-                            install_interactive_${a}
296
-                        fi
293
+                    # interactively obtain settings for this app
294
+                    if [[ $(function_exists install_interactive_${a}) == "1" ]]; then
295
+                        install_interactive_${a}
297 296
                     fi
298 297
                 fi
299 298
             fi
300
-        fi
301
-        app_index=$[app_index+1]
302
-    done
299
+            app_index=$[app_index+1]
300
+        done
301
+    fi
303 302
 
303
+    # now install the apps
304 304
     app_index=0
305 305
     for a in "${APPS_AVAILABLE[@]}"
306 306
     do
307 307
         if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
308 308
             if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
309 309
                 if [ ${is_interactive} ]; then
310
+                    # clears any removal indicator
310 311
                     reinstall_app ${a}
312
+
311 313
                     echo $"Installing application from interactive: ${a}"
312 314
                     install_${a}
313 315
                     echo $"${a} was installed from interactive"
314 316
                 else
317
+                    # check if the app was removed
315 318
                     if [[ $(app_is_removed ${a}) == "0" ]]; then
316 319
                         echo $"Installing application: ${a}"
317 320
                         install_${a}