Skill Tracer
Skills › gstack › gstack-upgrade › v1.91.65.0.sh

v1.91.65.0.sh

31 lines · gstack-upgrade/migrations/v1.91.65.0.sh at 3f79d81

1#!/usr/bin/env bash
2# Migration: v1.91.65.0 — install footprint (#1694). The release queue may
3# rename this file at /ship; it must match VERSION.
4#
5# Installs used to render every host's skills inside the checkout, so a global
6# Claude install carried ~576 extra SKILL.md files (32 MB) that Claude Code and
7# Cursor-agent scan. Record the hosts this install already serves (registry
8# rows, install roots that resolve here, host skills that link into its
9# renders), then prune the renders of every other host with
10# bin/gstack-host-renders.sh: generated files are backed up under
11# $GSTACK_STATE_ROOT/backups/host-renders/, anything not proven generated stays.
12# ./setup runs the same prune on every run; this covers an install upgraded
13# without one. Idempotent and non-fatal.
14set -u
15_gstack_migration_dir="${BASH_SOURCE[0]//\\//}"; _gstack_migration_dir="${_gstack_migration_dir%/*}"
16_gstack_bin="${_gstack_migration_dir}/../../bin"
17. "$_gstack_bin/gstack-state-root.sh" 2>/dev/null || { echo "$0: cannot resolve the gstack state root: $_gstack_bin/gstack-state-root.sh is missing. fix: reinstall with ./setup or /gstack-upgrade (docs/state-root.md)" >&2; exit 1; }
18gstack_state_root_select; GSTACK_STATE_ROOT="$_gstack_sr_root"
19. "$_gstack_bin/gstack-install-registry.sh" 2>/dev/null || exit 0
20. "$_gstack_bin/gstack-host-renders.sh" 2>/dev/null || exit 0
22INSTALL="${GSTACK_INSTALL_DIR:-${HOME:-}/.claude/skills/gstack}"
23[ -f "$INSTALL/VERSION" ] && [ -f "$INSTALL/setup" ] || exit 0
25gstack_render_hosts_seed "$INSTALL"
26if [ ! -f "$(gstack_render_hosts_file "$INSTALL")" ]; then
27 echo "host renders: no install from $INSTALL was found, so its renders were left alone; ./setup --host <name> records and prunes"
28 exit 0
29fi
30gstack_prune_host_renders "$INSTALL" || echo "host renders: some generated files could not be backed up and were left in place; the next ./setup retries" >&2
31exit 0