aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xprebuild.sh11
-rw-r--r--src/store.ts2
2 files changed, 12 insertions, 1 deletions
diff --git a/prebuild.sh b/prebuild.sh
index 9731276..f2d026e 100755
--- a/prebuild.sh
+++ b/prebuild.sh
@@ -5,3 +5,14 @@ sed -i -e "s|base: .*,|base: '/chrona/',|" vite.config.ts
sed -i -e "s|SERVER_DATA_URL = .*|SERVER_DATA_URL = (new URL(window.location.href)).origin + '/chrona/data/'|" \
-e "s|SERVER_IMG_PATH = .*|SERVER_IMG_PATH = '/img/chrona/'|" src/lib.ts
sed -i -e 's|DB_FILE = .*|DB_FILE = "/usr/local/www/db/chrona.db"|' backend/chrona.py
+
+# Copy contents of cal.py into chrona.py
+TEMP_FILE=_temp
+sed -n -e '0,/^# ==/ {/^# ==/d; p}' backend/chrona.py > $TEMP_FILE # Copy chrona.py content before first section
+sed -n -e '/^# ===/,$ p' backend/hist_data/cal.py >> $TEMP_FILE # Copy cal.py content at/after first section
+echo >> $TEMP_FILE
+sed -n -e '/^# ==/,$ p' backend/chrona.py >> $TEMP_FILE # Copy chrona.py content at/after first section
+mv $TEMP_FILE backend/chrona.py
+
+# Remove chrona.py's import of cal.py
+sed -i -e '/^from hist_data.cal import/d' backend/chrona.py
diff --git a/src/store.ts b/src/store.ts
index 0b64f4d..5a8e0c7 100644
--- a/src/store.ts
+++ b/src/store.ts
@@ -135,7 +135,7 @@ function getDefaultState(): StoreState {
},
// Other
- initialStartDate: new CalDate(1, 1, 1),
+ initialStartDate: new CalDate(1500, 1, 1),
initialEndDate: new CalDate(2000, 1, 1),
color,
borderRadius: 5,