Refactor how NickelMenu is set up
All checks were successful
Build and test project / build-and-test (push) Successful in 1m32s
All checks were successful
Build and test project / build-and-test (push) Successful in 1m32s
This commit is contained in:
@@ -8,8 +8,13 @@ mkdir -p "$PUBLIC_DIR"
|
||||
|
||||
echo "Fetching latest KOReader release info..."
|
||||
RELEASE_JSON=$(curl -fsSL https://api.github.com/repos/koreader/koreader/releases/latest)
|
||||
VERSION=$(echo "$RELEASE_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['tag_name'])")
|
||||
DOWNLOAD_URL=$(echo "$RELEASE_JSON" | python3 -c "import sys,json; assets=json.load(sys.stdin)['assets']; print(next(a['browser_download_url'] for a in assets if 'koreader-kobo-' in a['name'] and a['name'].endswith('.zip')))")
|
||||
VERSION=$(echo "$RELEASE_JSON" | jq -r '.tag_name')
|
||||
DOWNLOAD_URL=$(echo "$RELEASE_JSON" | jq -r '.assets[] | select(.name | test("koreader-kobo-.*\\.zip$")) | .browser_download_url')
|
||||
|
||||
if [ -z "$VERSION" ] || [ "$VERSION" = "null" ] || [ -z "$DOWNLOAD_URL" ] || [ "$DOWNLOAD_URL" = "null" ]; then
|
||||
echo "Error: Could not find KOReader Kobo release"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Downloading KOReader $VERSION..."
|
||||
curl -fL --progress-bar -o "$PUBLIC_DIR/koreader-kobo.zip" "$DOWNLOAD_URL"
|
||||
|
||||
Reference in New Issue
Block a user