chore: Add worktree deployment support (#2491)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent f21a46297a
commit 3f0d2ef14d
3 changed files with 25 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
# Worktrunk project configuration. See https://worktrunk.dev/config/.
# Install Node deps when a new worktree is created.
pre-start.yarn-install = "yarn install --immutable"
+1
View File
@@ -180,6 +180,7 @@
},
"scripts": {
"start": "rollup -c --watch",
"deployment-update": "./scripts/deployment-update-symlink.sh",
"build": "yarn run lint && yarn run rollup",
"docs": "docsify serve ./docs",
"docs-check-links": "docker run --init --rm -v \"$(pwd):/input\" -w /input lycheeverse/lychee --config lychee.toml \"./docs/\"",
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# `yarn deployment-update` — point the manual-test Home Assistant instance at
# this worktree.
#
# Repoints the `$ACC_LIVE_LINK` symlink (the dev static server's document root)
# at this worktree's `dist/`. HA loads the card from a fixed URL served off that
# static server, so switching worktrees is just this one symlink hop.
set -euo pipefail
if [[ -z "${ACC_LIVE_LINK:-}" ]]; then
echo "ACC_LIVE_LINK is not set — point it at the symlink to update." >&2
exit 1
fi
TARGET="$PWD/dist"
mkdir -p "$(dirname "$ACC_LIVE_LINK")"
ln -sfn "$TARGET" "$ACC_LIVE_LINK"
echo "Advanced Camera Card → $TARGET"
[[ -d "$TARGET" ]] || echo "(no dist/ here yet — run \`yarn start\` to build it)"