aboutsummaryrefslogtreecommitdiffstats
path: root/src/project.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-19 15:25:28 +0200
committeruser <user@clank>2026-08-19 15:25:28 +0200
commit49ac13f70aa3a9224e90699fe68d8463909239db (patch)
tree303c3cee9492e23de6a1f0afc7b2feffeba5c6aa /src/project.c
parentslosh: the logo flies into place -- a particle engine, statelessly (diff)
downloadslosh-49ac13f70aa3a9224e90699fe68d8463909239db.tar.gz
slosh-49ac13f70aa3a9224e90699fe68d8463909239db.tar.xz
slosh-49ac13f70aa3a9224e90699fe68d8463909239db.zip
slosh: layout files are *.layout, not *.layout.kdl
The old name argued that the extension should say how to read the file. The argument lost to a collision: zellij speaks the same KDL syntax under that same extension with a different schema, and to anyone arriving from there .kdl said *whose* file it is -- naming the wrong owner is worse than not naming the parser. So a layout is x.layout, a project's is slosh.layout, the name says what the file is and --check says how it was read. (It is still KDL underneath; point your editor's highlighting at *.layout.) Nobody's checked-in workspace vanishes on upgrade: the project scan still finds slosh.layout.kdl, never writes it, and where both spellings exist the new one wins, because two files disagreeing needs one answer. The unparseable-file heuristic in --check learned the new suffix -- it matched '.layout.' with a trailing dot, which the new name no longer has. The webdemo overlay moves with it (demo.layout), rebuilt and boot-checked.
Diffstat (limited to 'src/project.c')
-rw-r--r--src/project.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/project.c b/src/project.c
index 9146971..296cb25 100644
--- a/src/project.c
+++ b/src/project.c
@@ -81,6 +81,13 @@ static bool describe(const char *path, project_t *p) {
p->mtime = (int64_t)lst.st_mtime;
return true;
}
+ /* The old spelling, found but never written: see PROJECT_LAYOUT_FILE_OLD. */
+ if (exists(p->path, PROJECT_LAYOUT_FILE_OLD, &lst)) {
+ snprintf(p->layout, sizeof p->layout, "%s/%s", p->path,
+ PROJECT_LAYOUT_FILE_OLD);
+ p->mtime = (int64_t)lst.st_mtime;
+ return true;
+ }
return exists(p->path, ".git", NULL);
}