Report sign/house in significant transits; back up user.properties outside dist/

This commit is contained in:
ml
2026-07-05 17:18:20 +02:00
parent 28558b4343
commit 1136e3257a
9 changed files with 197 additions and 50 deletions
+20 -4
View File
@@ -17,6 +17,11 @@ ENGINE_I18N_DIR := engine/i18n
ENGINE_SCRIPTS_DIR := engine/scripts
RES_IMG_DIR := res/img
# Durable copy of the user's real birth data, outside dist/ (which is
# disposable - `make clean`, or just deleting the directory, wipes it).
# Gitignored: see .gitignore.
USER_PROPS_BACKUP := $(ENGINE_SCRIPTS_DIR)/user.properties.local
# Engine logic shared by the CLI and the test binary (no main()).
ENGINE_SRCS := $(ENGINE_SRC_DIR)/rng.c $(ENGINE_SRC_DIR)/tarot.c $(ENGINE_SRC_DIR)/tarot_data.c \
$(ENGINE_SRC_DIR)/astro.c $(ENGINE_SRC_DIR)/reading.c $(ENGINE_SRC_DIR)/i18n.c \
@@ -79,16 +84,27 @@ i18n:
cp $(ENGINE_I18N_DIR)/*.lang $(DIST_I18N_DIR)/
# run-engine.sh/run-interpreter.sh are refreshed every build.
# user.properties is only seeded once (from the placeholder template) so
# a rebuild never clobbers the user's own filled-in birth data.
#
# user.properties is backed up/restored across dist/ wipes rather than
# just "seeded once": if dist/user.properties exists and looks filled in
# (no leftover YOUR_... placeholder), it's copied out to
# USER_PROPS_BACKUP; otherwise, if that backup exists (e.g. dist/ was
# just deleted), it's copied back in; otherwise (genuinely first run)
# dist/user.properties is seeded from the placeholder template, same as
# before.
scripts:
@mkdir -p $(DIST_DIR)
cp $(ENGINE_SCRIPTS_DIR)/run-engine.sh $(DIST_DIR)/run-engine.sh
chmod +x $(DIST_DIR)/run-engine.sh
cp $(ENGINE_SCRIPTS_DIR)/run-interpreter.sh $(DIST_DIR)/run-interpreter.sh
chmod +x $(DIST_DIR)/run-interpreter.sh
test -f $(DIST_DIR)/user.properties || \
cp $(ENGINE_SCRIPTS_DIR)/user.properties.template $(DIST_DIR)/user.properties
@if [ -f $(DIST_DIR)/user.properties ] && ! grep -q 'YOUR_' $(DIST_DIR)/user.properties; then \
cp $(DIST_DIR)/user.properties $(USER_PROPS_BACKUP); \
elif [ -f $(USER_PROPS_BACKUP) ]; then \
cp $(USER_PROPS_BACKUP) $(DIST_DIR)/user.properties; \
elif [ ! -f $(DIST_DIR)/user.properties ]; then \
cp $(ENGINE_SCRIPTS_DIR)/user.properties.template $(DIST_DIR)/user.properties; \
fi
test: $(ENGINE_TEST_BINARY) $(SIGNIFICANCE_TEST_BIN) $(JSON_TEST_BIN)
./$(ENGINE_TEST_BINARY)