feat(dev): enhance development install script with validation options

This commit is contained in:
kaitranntt
2025-11-27 09:33:16 -05:00
parent 7a413a81b7
commit 06f81d6c3e
+32 -11
View File
@@ -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"