← Files ReactVision XR BuilderARCHIVED FILE

build.sh

1.83 KB · Nov 30, 2026 · 07:45 UTC

↓ Download file

See the change to this file →

#!/bin/sh
# Builds one zip per host from this folder: dist/<name>-<version>-chatgpt.zip and -claude.zip.
# Usage: sh build.sh [path to a viro-mcp checkout]
# The ChatGPT zip holds plugin.json + mcp.json (agent-plugins.org layout), the Claude zip
# .claude-plugin/plugin.json + .mcp.json. Both share skills/ and assets/.
set -eu
repo=""
[ $# -gt 0 ] && repo=$(cd "$1" && pwd)
cd "$(dirname "$0")"

node -e '
const a = require("./plugin.json"), b = require("./.claude-plugin/plugin.json");
const bad = ["name", "version", "description"].filter((k) => a[k] !== b[k]);
if (bad.length) { console.error("plugin.json and .claude-plugin/plugin.json differ on: " + bad.join(", ")); process.exit(1); }
const ua = require("./mcp.json").mcpServers, ub = require("./.mcp.json").mcpServers;
for (const k of Object.keys(ua)) if (!ub[k] || ub[k].url !== ua[k].url) { console.error("mcp.json and .mcp.json differ on server " + k); process.exit(1); }
'

name=$(node -p 'require("./plugin.json").name')
version=$(node -p 'require("./plugin.json").version')
shared="skills"
[ -d assets ] && shared="$shared assets"

rm -rf dist && mkdir dist
# shellcheck disable=SC2086
zip -rq "dist/$name-$version-chatgpt.zip" plugin.json mcp.json $shared -x '*.DS_Store'
# shellcheck disable=SC2086
zip -rq "dist/$name-$version-claude.zip" .claude-plugin .mcp.json README.md $shared -x '*.DS_Store'
ls -1 dist

# With a viro-mcp checkout as the first argument, also copy the Claude layout into its plugin/ folder.
if [ -n "$repo" ]; then
  [ -f "$repo/.claude-plugin/marketplace.json" ] || { echo "$repo has no .claude-plugin/marketplace.json" >&2; exit 1; }
  rm -rf "$repo/plugin" && mkdir "$repo/plugin"
  # shellcheck disable=SC2086
  cp -R .claude-plugin .mcp.json README.md $shared "$repo/plugin/"
  find "$repo/plugin" -name .DS_Store -delete
  echo "copied the Claude plugin to $repo/plugin"
fi

SHA-256: f9751325daf75eeb4b49a9cb4c6d30a5bf678dae96ca0d55bd0ef5d76ce137b3