#!/bin/sh # Runs after `opencode-sandbox wt add [args]` in the new worktree. # Environment: WT_DIR, WT_BRANCH, WT_SLUG, MAIN_ROOT. Arguments: extra args of `wt add`. # Rename to wt-post-add and chmod +x to enable. A non-zero exit fails the command. set -eu # Example: give each worktree its own port and start its stack # port=$((3000 + $(git -C "$MAIN_ROOT" worktree list | wc -l) * 10)) # echo "APP_PORT=$port" > .env # make up