From 2a1118e461990daca164feb427d84fef87e27149 Mon Sep 17 00:00:00 2001 From: Param Harrison Date: Thu, 8 Oct 2026 22:23:25 +0300 Subject: [PATCH] Give each worktree its own port, database file and packages with worktrunk hooks Co-Authored-By: Claude Opus 5.5 --- .config/wt.toml | 8 ++++++++ .gitignore | 1 + 2 files changed, 9 insertions(+) create mode 100644 .config/wt.toml diff --git a/.config/wt.toml b/.config/wt.toml new file mode 100644 index 0000000..c151ea3 --- /dev/null +++ b/.config/wt.toml @@ -0,0 +1,8 @@ +# worktrunk hooks: each worktree gets its own packages, its own port and its own database file. + +[pre-start] +deps = "bun install --frozen-lockfile > /dev/null" +env = "echo PORT={{ branch | hash_port }} > .env && echo SPLITBILL_DB=splitbill_{{ branch | sanitize_db }}.sqlite >> .env" + +[pre-remove] +drop = "rm -f splitbill_{{ branch | sanitize_db }}.sqlite" diff --git a/.gitignore b/.gitignore index c2a17f1..66191ac 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ node_modules/ .factory/runs/ *.log .worktrees/ +.env