Files
Strata/update.sh
T
Niko1221 4ba7c94d4d UPDATE.bat / update.sh: update Strata without starting the model (#475)
In a git clone they run `git pull --ff-only` (a zip copy is told to download the new zip), then `setup.py --update`:
what a plain start does to an install before it starts the model - the Python packages, the ready-made engine when
MIN_ENGINE is newer (a compiled one when its source changed), each model's config upgrades and its draft subset, the
Windows AMD runtime - and nothing else: no question, no model files, no start. Both scripts run from one parsed
block, since the pull can rewrite the running script. Documented in docs/INSTALL.md (Updating) and the README.
2026-10-02 11:06:51 +02:00

32 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
# Update Strata without starting the model (#475): the newest code (git pull, when this folder is a git clone), then
# what ./setup.sh does before a start - the engine (a new ready-made one when this version needs it, or compiled
# again when its source changed), the Python packages, each installed model's settings and draft subset. The model
# files are not touched. Start the model later with ./setup.sh. Options are passed on to setup.py.
cd "$(dirname "$0")" || exit 1
# all of it in a function, read before it runs: the git pull below can change this very file
main() {
if [ -e .git ]; then
if ! command -v git >/dev/null 2>&1; then
echo "This folder is a git clone, but git is not installed: install it (sudo apt install git) or run"
echo "\"git pull\" here yourself, then run ./update.sh again."
exit 1
fi
echo "Getting the newest Strata (git pull) ..."
if ! git pull --ff-only; then
echo
echo "git pull did not succeed (the reason is above): nothing was updated. Files you changed here can stop it:"
echo "\"git status\" lists them."
exit 1
fi
else
echo "This copy of Strata was not made with git, so it cannot fetch new files itself. Download the newest one:"
echo " https://github.com/Niko1221/Strata/archive/refs/heads/main.zip"
echo "unzip it anywhere and run ./setup.sh (or ./update.sh) in it: it finds the model files in Strata-data and"
echo "sets itself up the same way - nothing big is downloaded again."
echo "Checking this copy's engine and settings meanwhile ..."
fi
exec sh ./setup.sh --update "$@"
}
main "$@"