From 65513eab82af3157266967eaad714e54c240be38 Mon Sep 17 00:00:00 2001 From: Roland Date: Thu, 11 Jun 2026 20:05:10 -0600 Subject: [PATCH] Upgrade script upgrades single-file-cli to the pinned version. Old single-file versions (1.x) create compressed Archives without the SingleFile comment header in the self-extracting prelude, which WROLPi rejects as invalid. The install scripts only install single-file when it is missing, so existing machines were never upgraded. Co-Authored-By: Claude Fable 5 --- scripts/upgrade.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index e5721642..b4bb2ffb 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -74,6 +74,21 @@ upgrade_deno() { upgrade_deno || echo "Deno upgrade failed, continuing..." +# Upgrade single-file to the pinned version; old versions (1.x) create compressed Archives without +# the SingleFile comment header in the prelude, which WROLPi cannot validate. +# readability-extractor is pinned alongside it to match the install scripts. +upgrade_singlefile() { + SINGLE_FILE_VERSION="2.0.73" + if [ "$(single-file --version 2>/dev/null)" != "${SINGLE_FILE_VERSION}" ]; then + echo "Upgrading single-file-cli to ${SINGLE_FILE_VERSION}..." + npm i -g single-file-cli@${SINGLE_FILE_VERSION} readability-extractor@0.0.6 + else + echo "single-file-cli ${SINGLE_FILE_VERSION} already installed" + fi +} + +upgrade_singlefile || echo "single-file upgrade failed, continuing..." + # Clear Python bytecode cache before upgrading packages. echo "Clearing Python bytecode cache..." find /opt/wrolpi/venv -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || :