From 56df73944e3ab256c31b17289f5c7460a9714333 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 1 Oct 2016 09:48:57 +0100 Subject: [PATCH] App install logic --- src/freedombone-utils-selector | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/freedombone-utils-selector b/src/freedombone-utils-selector index ea95c261..23f80676 100755 --- a/src/freedombone-utils-selector +++ b/src/freedombone-utils-selector @@ -283,35 +283,38 @@ function remove_apps { function install_apps { is_interactive=$1 - app_index=0 - for a in "${APPS_AVAILABLE[@]}" - do - if [[ $(app_is_removed ${a}) == "0" ]]; then + # interactive install configuration for each app + if [ ${is_interactive} ]; then + app_index=0 + for a in "${APPS_AVAILABLE[@]}" + do if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then - if [ ${is_interactive} ]; then - # interactively obtain settings for this app - if [[ $(function_exists install_interactive_${a}) == "1" ]]; then - install_interactive_${a} - fi + # interactively obtain settings for this app + if [[ $(function_exists install_interactive_${a}) == "1" ]]; then + install_interactive_${a} fi fi fi - fi - app_index=$[app_index+1] - done + app_index=$[app_index+1] + done + fi + # now install the apps app_index=0 for a in "${APPS_AVAILABLE[@]}" do if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then if [ ${is_interactive} ]; then + # clears any removal indicator reinstall_app ${a} + echo $"Installing application from interactive: ${a}" install_${a} echo $"${a} was installed from interactive" else + # check if the app was removed if [[ $(app_is_removed ${a}) == "0" ]]; then echo $"Installing application: ${a}" install_${a}