CRITICAL FIX: Auto-clear both production and dev cache files on git pull

- Previous version only cleared .sysref.beta (dev cache)
- Production installations use .sysref (without beta suffix)
- Now clears both .sysref and .sysref.beta automatically
- Fixes issue where old cache data persisted across server migrations
- Users on production installs will now get fresh cache on every git pull
This commit is contained in:
Developer
2026-03-20 01:59:58 -04:00
parent 10e131014d
commit 00cdb0a663
+10 -6
View File
@@ -691,13 +691,17 @@ init_directories() {
startup_detection() { startup_detection() {
# Auto-clear cache if toolkit files are newer (fresh git pull) # Auto-clear cache if toolkit files are newer (fresh git pull)
# This ensures users always get fresh data after git updates # This ensures users always get fresh data after git updates
if [ -f "$BASE_DIR/.sysref.beta" ] && [ -f "$BASE_DIR/launcher.sh" ]; then # Handle both production (.sysref) and dev (.sysref.beta) cache names
# If launcher.sh is newer than cache, it means git just pulled updates local cache_file
# and we should rebuild cache with current code for cache_file in "$BASE_DIR/.sysref.beta" "$BASE_DIR/.sysref"; do
if [ "$BASE_DIR/launcher.sh" -nt "$BASE_DIR/.sysref.beta" ]; then if [ -f "$cache_file" ] && [ -f "$BASE_DIR/launcher.sh" ]; then
rm -f "$BASE_DIR/.sysref.beta" "$BASE_DIR/.sysref.beta.timestamp" 2>/dev/null || true # If launcher.sh is newer than cache, it means git just pulled updates
# and we should rebuild cache with current code
if [ "$BASE_DIR/launcher.sh" -nt "$cache_file" ]; then
rm -f "$cache_file" "${cache_file}.timestamp" 2>/dev/null || true
fi
fi fi
fi done
# Initialize system detection first (required for show_system_overview) # Initialize system detection first (required for show_system_overview)
if [ -z "${SYS_DETECTION_COMPLETE:-}" ]; then if [ -z "${SYS_DETECTION_COMPLETE:-}" ]; then