Browse Source

Option for interactive install function

stockholm
Bob Mottram 5 years ago
parent
commit
dce19538ac
  1. 2
      src/freedombone-addremove
  2. 11
      src/freedombone-utils-depends
  3. 7
      src/freedombone-utils-selector

2
src/freedombone-addremove

@ -164,7 +164,7 @@ function install_apps_interactive {
# install the apps
read_configuration
install_apps
install_apps interactive
}
${PROJECT_NAME}-tests

11
src/freedombone-utils-depends

@ -30,10 +30,17 @@
function function_check {
if [ ! "$(type ${1} 2>/dev/null)" ]; then
echo $"Dependency error: The function ${1} has not been defined"
exit 72528
echo $"Dependency error: The function ${1} has not been defined"
exit 72528
fi
}
function function_exists {
if [ ! "$(type ${1} 2>/dev/null)" ]; then
echo "0"
else
echo "1"
fi
}
# NOTE: deliberately there is no "exit 0"

7
src/freedombone-utils-selector

@ -202,11 +202,18 @@ function remove_apps {
}
function install_apps {
is_interactive=$1
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
fi
echo $"Installing application: ${a}"
install_${a}
echo $"${a} was installed"

Loading…
Cancel
Save