-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdeploy.sh
More file actions
36 lines (28 loc) · 955 Bytes
/
Copy pathdeploy.sh
File metadata and controls
36 lines (28 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Build, package, and install the extension in one shot
# Usage: ./deploy.sh [version]
# Example: ./deploy.sh 0.3.1
set -e
cd "$(dirname "$0")"
# Check for uncommitted changes — refuse to deploy dirty tree
if [ -n "$(git status --porcelain)" ]; then
echo "ERROR: Uncommitted changes detected. Commit before deploying."
echo ""
git status --short
exit 1
fi
# Bump version if provided
if [ -n "$1" ]; then
echo "=== Bumping version to $1 ==="
npm version "$1" --no-git-tag-version
fi
VERSION=$(node -p "require('./package.json').version")
echo "=== Version: $VERSION ==="
echo "=== Building ==="
npm run build
echo "=== Packaging VSIX ==="
npx @vscode/vsce package --no-git-tag-version
VSIX="tia-connect-vscode-${VERSION}.vsix"
echo "=== Installing $VSIX ==="
code --install-extension "$VSIX" --force
echo "=== Done! Reload VS Code window (Ctrl+Shift+P > Reload Window) ==="