diff --git a/README.md b/README.md index 51e22c2..aaac96b 100644 --- a/README.md +++ b/README.md @@ -317,6 +317,11 @@ The URL from which to download the archive. The URL can be generated by a series of commands, for example when you need to parse an xml file for the latest URL. (See `bbedit`, `desktoppr`, or `omnigraffle` for examples.) Sometimes version differs between Intel and Apple Silicon versions. (See `brave`, `obsidian`, `omnidisksweeper`, or `notion`). +- `curlOptions`: (optional) +Options to the `curl` command, needed for `curl` to be able to download the software. +Usually used for adding extra headers that some servers need in order to serve the file. +(see “mocha”-labels, for examples). + - `appNewVersion` (optional, but recommended): Version of the downloaded software. If given, it will be compared to installed version, to see if download is different. diff --git a/fragments/header.sh b/fragments/header.sh index 36f8500..baea5b9 100644 --- a/fragments/header.sh +++ b/fragments/header.sh @@ -149,6 +149,11 @@ REOPEN="yes" # URL to download the dmg. # Can be generated with a series of commands (see BBEdit for an example). # +# - curlOptions: (optional) +# Options to the curl command, needed for curl to be able to download the software. +# Usually used for adding extra headers that some servers need in order to serve the file. +# (see “mocha”-labels, for examples). +# # - appNewVersion: (optional) # Version of the downloaded software. # If given, it will be compared to the installed version, to see if the download is different. diff --git a/fragments/main.sh b/fragments/main.sh index 71994af..96fdb0e 100644 --- a/fragments/main.sh +++ b/fragments/main.sh @@ -178,7 +178,9 @@ else displaynotification "Downloading new $name" "Download in progress …" fi fi - if ! curl -fsL ${=curlOptions} "$downloadURL" -o "$archiveName"; then + set -x + if ! curl -fsL ${curlOptions} "$downloadURL" -o "$archiveName"; then + set +x printlog "error downloading $downloadURL" message="$name update/installation failed. This will be logged, so IT can follow up." if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then @@ -192,7 +194,7 @@ else cleanupAndExit 2 fi fi - +set +x # MARK: when user is logged in, and app is running, prompt user to quit app if [[ $BLOCKING_PROCESS_ACTION == "ignore" ]]; then printlog "ignoring blocking processes"