Files
claude-code-chat/build/open-vsix/build.sh
andrepimenta cb5943eec5 Replace PATH injection with post-install executable.path auto-config
Drops the cross-platform PATH-injection workaround in favor of probing
claude availability after install and writing the known install location
to claudeCodeChat.executable.path when it's not on PATH. Terminals for
login/model/usage/slash commands now launch claude directly via
createTerminal's shellPath/shellArgs so they work identically across
PowerShell, cmd, bash, and zsh. WSL nodePath is now optional (recent
Claude ships as a native binary) and its field moved below claudePath.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 22:44:00 +01:00

72 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# Build script for Open VSIX version
# This applies Open VSIX-specific changes, builds the package, then reverts
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VERSION="2.0.6"
OUTPUT_NAME="vsix-claude-code-chat-${VERSION}.vsix"
echo "Building Open VSIX version ${VERSION}..."
# Backup original files to build folder
cp package.json "${SCRIPT_DIR}/package.json.backup"
cp src/extension.ts "${SCRIPT_DIR}/extension.ts.backup"
# Backup original icon.png if it exists
if [ -f "icon.png" ]; then
mv icon.png "${SCRIPT_DIR}/icon.png.backup"
fi
# Copy Open VSIX icon
cp "${SCRIPT_DIR}/icon.png" icon.png
echo "Copied Open VSIX icon"
# Temporarily remove icon-bubble.png (not needed for Open VSIX)
if [ -f "icon-bubble.png" ]; then
mv icon-bubble.png "${SCRIPT_DIR}/icon-bubble.png.backup"
fi
# Apply Open VSIX changes to package.json
sed -i.bak 's/"displayName": "Chat for Claude Code"/"displayName": "Claude Code Chat"/' package.json
sed -i.bak 's/"icon": "icon-bubble.png"/"icon": "icon.png"/g' package.json
rm -f package.json.bak
# Apply Open VSIX changes to extension.ts
sed -i.bak "s/icon-bubble.png/icon.png/g" src/extension.ts
rm -f src/extension.ts.bak
echo "Applied Open VSIX changes to package.json and extension.ts"
# Compile TypeScript
echo "Compiling TypeScript..."
npm run compile
# Build the VSIX
echo "Building VSIX package..."
vsce package --out "${OUTPUT_NAME}"
# Restore original files from build folder
mv "${SCRIPT_DIR}/package.json.backup" package.json
mv "${SCRIPT_DIR}/extension.ts.backup" src/extension.ts
# Restore original icon
rm -f icon.png
if [ -f "${SCRIPT_DIR}/icon.png.backup" ]; then
mv "${SCRIPT_DIR}/icon.png.backup" icon.png
fi
# Restore icon-bubble.png
if [ -f "${SCRIPT_DIR}/icon-bubble.png.backup" ]; then
mv "${SCRIPT_DIR}/icon-bubble.png.backup" icon-bubble.png
fi
# Recompile with original extension.ts
echo "Recompiling with original files..."
npm run compile
echo "Restored original files"
echo "Built: ${OUTPUT_NAME}"