Ensure settings directory exists before saving and set default settings file path in run.sh

This commit is contained in:
2026-03-20 08:17:02 +01:00
parent 66c1678d34
commit 27e9202e25
2 changed files with 16 additions and 0 deletions

15
run.sh
View File

@@ -104,6 +104,21 @@ fi
TORCH_FLAVOR="$(resolve_torch_flavor)"
RECREATE_VENV=0
if [ -z "${HEIMGEIST_SETTINGS_FILE:-}" ]; then
case "$(uname -s)" in
Darwin)
HEIMGEIST_SETTINGS_FILE="${HOME}/Library/Application Support/Heimgeist/settings.json"
;;
Linux)
HEIMGEIST_SETTINGS_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/Heimgeist/settings.json"
;;
esac
if [ -n "${HEIMGEIST_SETTINGS_FILE:-}" ]; then
export HEIMGEIST_SETTINGS_FILE
mkdir -p "$(dirname "$HEIMGEIST_SETTINGS_FILE")"
fi
fi
if [ ! -x "$VENV_DIR/bin/python" ] || ! "$VENV_DIR/bin/python" -c 'import sys; raise SystemExit(0 if sys.version_info[:2] == (3, 13) else 1)'; then
RECREATE_VENV=1
fi