aboutsummaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-09-04 09:48:35 +0200
committerdefault <nobody@localhost>2024-09-04 09:48:35 +0200
commit6778350211aeae076be80393cbef637e0218ad49 (patch)
treeaf2edb5302be580629b62a1a454463e142b90842 /data.c
parentd8e77aca76c120ab5a55f97aa591501080c24ee2 (diff)
If style.css does not exist, it's created with the default one.
Diffstat (limited to 'data.c')
-rw-r--r--data.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/data.c b/data.c
index bbd0e0c..7197320 100644
--- a/data.c
+++ b/data.c
@@ -156,6 +156,14 @@ int srv_open(const char *basedir, int auto_upgrade)
/* read (and drop) emojis.json, possibly creating it */
xs_free(emojis());
+ /* if style.css does not exist, create it */
+ xs *css_fn = xs_fmt("%s/style.css", srv_basedir);
+
+ if (mtime(css_fn) == 0) {
+ srv_log(xs_fmt("Writing style.css"));
+ write_default_css();
+ }
+
return ret;
}