From 06f81d6c3e9064b0a44a6dcb8f0776aa93b4b034 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Thu, 27 Nov 2025 09:33:16 -0500 Subject: [PATCH] feat(dev): enhance development install script with validation options --- scripts/dev-install.sh | 43 +++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/scripts/dev-install.sh b/scripts/dev-install.sh index 5d3d88c3..6c4f3c5b 100755 --- a/scripts/dev-install.sh +++ b/scripts/dev-install.sh @@ -1,35 +1,56 @@ #!/bin/bash # Auto-install CCS locally for testing changes +# Usage: ./scripts/dev-install.sh +# +# Options: +# --skip-validate Skip validation (faster, use when you're sure code is good) set -e -echo "[CCS Dev Install] Starting..." +SKIP_VALIDATE=false +for arg in "$@"; do + case $arg in + --skip-validate) SKIP_VALIDATE=true ;; + esac +done + +echo "[i] CCS Dev Install - Starting..." # Get to the right directory cd "$(dirname "$0")/.." +# Build TypeScript first +echo "[i] Building TypeScript..." +bun run build + # Pack the npm package -echo "[CCS Dev Install] Creating package..." -npm pack +echo "[i] Creating package..." +if [ "$SKIP_VALIDATE" = true ]; then + # Skip validation, just pack + bun pm pack --ignore-scripts +else + # Full pack with validation (runs prepublishOnly) + bun pm pack +fi # Find the tarball -TARBALL=$(ls -t kaitranntt-ccs-*.tgz | head -1) +TARBALL=$(ls -t kaitranntt-ccs-*.tgz 2>/dev/null | head -1) if [ -z "$TARBALL" ]; then - echo "[CCS Dev Install] ERROR: No tarball found" + echo "[X] ERROR: No tarball found" exit 1 fi -echo "[CCS Dev Install] Found tarball: $TARBALL" +echo "[i] Found tarball: $TARBALL" -# Install globally -echo "[CCS Dev Install] Installing globally..." +# Install globally using npm (handles bin linking correctly) +echo "[i] Installing globally with npm..." npm install -g "$TARBALL" # Clean up -echo "[CCS Dev Install] Cleaning up..." +echo "[i] Cleaning up..." rm "$TARBALL" -echo "[CCS Dev Install] ✓ Complete! CCS is now updated." +echo "[OK] Complete! CCS is now updated." echo "" -echo "Test with: ccs glmt --version" +echo "Test with: ccs --version"