Upgrade script upgrades single-file-cli to the pinned version.
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

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 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-06-11 20:05:10 -06:00
parent 0a776d030f
commit 65513eab82
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680

View file

@ -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 || :