diff --git a/fragments/functions.sh b/fragments/functions.sh index 79c1aa2..a60a6f3 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -14,10 +14,10 @@ cleanupAndExit() { # $1 = exit code, $2 message, $3 level printlog "Debugging enabled, Deleting tmpDir output was:\n$deleteTmpOut" DEBUG fi - # If displaying progres, quit dialog - if [[ $SHOWPROGRESS == "yes" ]]; then - quitDialog "$DIALOGCMDFILE" - fi +# # If displaying progres, quit dialog +# if [[ $DIALOG_PROGRESS == "main" || $DIALOG_PROGRESS == "list" ]]; then +# quitDialog "$DIALOGCMDFILE" +# fi # If we closed any processes, reopen the app again reopenClosedProcess @@ -829,10 +829,11 @@ runUpdateTool() { finishing() { printlog "Finishing..." - if [[ $SHOWPROGRESS == "yes" ]]; then + if [[ $DIALOG_PROGRESS == "main" || $DIALOG_PROGRESS == "list" ]]; then updateDialogProgress "complete" "$DIALOGCMDFILE" fi - sleep 10 # wait a moment to let spotlight catch up + + sleep 5 # wait a moment to let spotlight catch up getAppVersion if [[ -z $appversion ]]; then @@ -951,7 +952,7 @@ launchDialog() { local name=$1 local log=${2:-$DIALOG_CMD_FILE} if [[ -z "$log" ]]; then - log="/var/tmp/dialog.log" + log="/private/var/tmp/dialog.log" fi # check for laptop or desktop #if /usr/bin/pmset -g batt | grep -iq "battery"; then diff --git a/fragments/header.sh b/fragments/header.sh index 1be0c2d..e2ba549 100644 --- a/fragments/header.sh +++ b/fragments/header.sh @@ -141,8 +141,10 @@ IGNORE_DND_APPS="" DIALOG_PROGRESS="no" # options: # - no do not show download or install progress (default) -# - yes show download or install progress -DIALOG_CMD_FILE="/var/tmp/dialog.log" +# - main show download or install progress in the main progress bar +# - list show download or install progress with each list item +# the `-list` option requires the DIALOG_LIST_INDEX to be set +DIALOG_CMD_FILE="/private/var/tmp/dialog.log" diff --git a/fragments/main.sh b/fragments/main.sh index 4e44ccb..7c41a20 100644 --- a/fragments/main.sh +++ b/fragments/main.sh @@ -195,21 +195,15 @@ else fi fi - if [[ $DIALOG_PROGRESS == "yes" ]]; then + if [[ $DIALOG_PROGRESS == "main" || $DIALOG_PROGRESS == "list" ]]; then # pipe - pipe="/tmp/dlpipe" + pipe="$tmpDir/downloadpipe" # initialise named pipe for curl output initNamedPipe create $pipe # run the pipe read in the background readDownloadPipe $pipe "$DIALOGCMDFILE" & downloadPipePID=$! - # TODO: this should _not_ be part of Installomator. - # Also there should be a check if DIALOG_PROGRESS is set but dialog is not installed - - # launch dialog - launchDialog "$name" "$DIALOGCMDFILE" & - # curl (extract - line in "# MARK: download the archive" of Installomator.sh) curlDownload=$(curl -fL -# --show-error ${curlOptions} "$downloadURL" -o "$archiveName" 2>&1 | tee $pipe) # because we are tee-ing the output, we want the pipe status of the first command in the chain, not the most recent one