diff options
| author | Terry Truong <terry06890@gmail.com> | 2023-01-22 14:59:06 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2023-01-22 14:59:06 +1100 |
| commit | 4b81d58655deef4223884b5d6e043e9e9f1b0d90 (patch) | |
| tree | dc5f958ecfbbc0d63ac1a774203ab53190ddb8df | |
| parent | 436dd015471cbdea443cfd98536e55e683833c48 (diff) | |
For deployment, copy cal.py content into chrona.py
| -rwxr-xr-x | prebuild.sh | 11 | ||||
| -rw-r--r-- | src/store.ts | 2 |
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, |
