mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-23 00:21:14 +01:00
fix(setup): per-install renders for renamed, vendored and custom-config installs, space-safe alias roots, per-host /cso launcher path (#1882, #2906)
This commit is contained in:
1 parent
b8acf1584d
commit
aefcb1bd4e
10 files changed
+222
-17
No files matched your search
@@ -139,6 +139,22 @@ EOF
|
||||
return "$rc"
|
||||
}
|
||||
|
||||
# gstack_install_render_dir HOST ROOT — the per-install render directory for an
|
||||
# install whose root is not the host's default (render contract,
|
||||
# docs/ADDING_A_HOST.md): keyed by the root's realpath, so two installs never
|
||||
# share or overwrite a render.
|
||||
gstack_install_render_dir() {
|
||||
local real
|
||||
real="$(cd "$2" 2>/dev/null && pwd -P)" || real="$2"
|
||||
printf '%s/render/installs/%s-%s\n' "${GSTACK_STATE_ROOT:?gstack-install-registry: GSTACK_STATE_ROOT is not set}" "$1" "$(printf '%s' "$real" | cksum | awk '{print $1}')"
|
||||
}
|
||||
|
||||
# gstack_install_render_for HOST DESTINATION — the render directory the
|
||||
# registry recorded for that install, or nothing when it serves committed files.
|
||||
gstack_install_render_for() {
|
||||
gstack_install_registry_rows | awk -F '\t' -v h="$1" -v d="$2" '$1 == h && $4 == d && $9 != "committed" && $9 != "-" { r = $9 } END { if (r != "") print r }'
|
||||
}
|
||||
|
||||
# gstack_host_tier HOST — the support tier declared in hosts/<host>.ts.
|
||||
# test/host-config.test.ts keeps this table equal to hosts/index.ts.
|
||||
gstack_host_tier() {
|
||||
|
||||
+7
-1
@@ -77,7 +77,13 @@ DISABLED_COUNT=0
|
||||
# out-dir instead of the tracked install checkout. When a render exists for a
|
||||
# skill, relink serves it — otherwise a config change would silently flip
|
||||
# every skill back to the canonical (blockless) source.
|
||||
RENDER_DIR="${GSTACK_USER_RENDER_DIR:-$GSTACK_STATE_ROOT/render/claude}"
|
||||
RENDER_DIR="${GSTACK_USER_RENDER_DIR:-}"
|
||||
# An install outside the default root serves the per-install render setup
|
||||
# recorded for it in the registry (render contract, #1882).
|
||||
if [ -z "$RENDER_DIR" ] && command -v gstack_install_render_for >/dev/null 2>&1; then
|
||||
RENDER_DIR="$(gstack_install_render_for claude "$SKILLS_DIR")"
|
||||
fi
|
||||
RENDER_DIR="${RENDER_DIR:-$GSTACK_STATE_ROOT/render/claude}"
|
||||
|
||||
# ─── Ownership gate ───────────────────────────────────────────────────────────
|
||||
# relink runs on every ./setup and used to `rm -rf` any same-name entry with a
|
||||
|
||||
Reference in new issue
Block a user