From 8afbc2c676a2226dc590c2f1f89ebd061b6ae1ef Mon Sep 17 00:00:00 2001 From: Nemo Date: Sat, 29 May 2021 14:46:49 +0530 Subject: [PATCH] Fix koreader Update script --- update.koreader | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/update.koreader b/update.koreader index 8a42079..cb98a17 100755 --- a/update.koreader +++ b/update.koreader @@ -1,4 +1,7 @@ #!/bin/bash +set -euo pipefail +IFS=$'\n\t' + # Updates koreader @@ -13,8 +16,9 @@ DOWNLOAD_URL=$(cat "$JSON_PATH" | jq --raw-output '.assets[] |select(.name | con FILE_NAME=$(cat "$JSON_PATH" | jq --raw-output '.assets[] |select(.name | contains("kindle-v"))|.name') echo "Latest version is $FILE_NAME" +echo "Download URL is $DOWNLOAD_URL" -wget --no-clobber --directory-prefix="$STORAGE_DIRECTORY" "$DOWNLOAD_URL" --output-file "$FILE_NAME" +wget --no-clobber "$DOWNLOAD_URL" --output-document "$STORAGE_DIRECTORY/$FILE_NAME" if [[ -d "$KINDLE_MOUNT_PATH" ]]; then if [[ $@ == *'--please'* ]]; then