← Commit history

packaging: install hook downloads the release binary

Colby Knox ·9262cab0b1 ·4d ago ·parent 192723b
3 files changed +52
install.shadded+26
@@ -0,0 +1,26 @@+#!/usr/bin/env bash+# Install hook for board-to-molecule. adom-wiki `pkg install` does not pull+# release assets, so this downloads the version-pinned Linux binary from the+# page's release, then installs the skill and the kicad-to-molecule shim.+set -euo pipefail+cd "$(dirname "$0")"++VER="$(grep -o '"version"[^,]*' package.json | grep -o '[0-9][0-9.]*' | head -1)"+BIN_DIR="${HOME}/.local/bin"+mkdir -p "$BIN_DIR"+URL="https://wiki.adom.inc/download/adom/board-to-molecule/${VER}/board-to-molecule"+TMP="$(mktemp)"+if curl -fsSL "$URL" -o "$TMP"; then+  install -m 0755 "$TMP" "$BIN_DIR/board-to-molecule"+  echo "OK: installed board-to-molecule ${VER} -> $BIN_DIR/board-to-molecule"+elif command -v cargo >/dev/null 2>&1; then+  echo "WARN: release download failed; building from source with cargo" >&2+  cargo build --release && install -m 0755 target/release/board-to-molecule "$BIN_DIR/board-to-molecule"+else+  echo "ERROR: could not download the binary and cargo is not available" >&2+  exit 1+fi+rm -f "$TMP"+install -m 0755 bin/kicad-to-molecule "$BIN_DIR/kicad-to-molecule"+"$BIN_DIR/board-to-molecule" install+case ":$PATH:" in *":$BIN_DIR:"*) ;; *) echo "Hint: add $BIN_DIR to PATH" ;; esac
package.jsonadded+21
@@ -0,0 +1,21 @@+{+  "slug": "board-to-molecule",+  "version": "1.0.0",+  "type": "app",+  "description": "Turn any KiCad, Fusion/EAGLE, or Altium board into an Adom molecule: wings plus MP1-MP4 machine pins, written back in the board's own format. Rust CLI with a before/after 3D viewer.",+  "tags": ["molecule", "kicad", "fusion", "altium", "eagle", "pcb", "machine-pins", "rust", "cli", "webview"],+  "dependencies": {},+  "scripts": { "install": "./install.sh", "uninstall": "./uninstall.sh" },+  "license": "proprietary",+  "discovery_triggers": [+    "make this board a molecule", "kicad to molecule", "fusion board to molecule", "altium board to molecule",+    "add machine pins to my board", "add wings and MP1-MP4 pins", "turn a pcb into an adom molecule",+    "convert pcbdoc to molecule", "eagle brd to molecule", "kicad-to-molecule"+  ],+  "discovery_pitch": "One Rust CLI that adds wings and MP1-MP4 machine pins to KiCad, Fusion/EAGLE, and Altium boards in their own format, then proves the result anchors in step2glb.",+  "sample_prompts": [+    { "label": "Altium", "prompt": "Turn ~/boards/sensor.PcbDoc into a molecule and show me the before and after in 3D" },+    { "label": "Fusion", "prompt": "Make my Fusion board.brd a molecule with V-cut lines" },+    { "label": "Plan", "prompt": "What size machine pins will this KiCad board get?" }+  ]+}
uninstall.shadded+5
@@ -0,0 +1,5 @@+#!/usr/bin/env bash+set -euo pipefail+rm -f "$HOME/.local/bin/board-to-molecule" "$HOME/.local/bin/kicad-to-molecule"+rm -rf "$HOME/.claude/skills/board-to-molecule"+echo "OK: removed board-to-molecule, the kicad-to-molecule shim, and the skill"