-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdev-install.sh
More file actions
executable file
·64 lines (51 loc) · 1.39 KB
/
Copy pathdev-install.sh
File metadata and controls
executable file
·64 lines (51 loc) · 1.39 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Dev Install: Build, Package, Reinstall
set -e
set -o pipefail
run_command() {
local cmd="$1"
local is_windows_shell=0
local cmd_path=""
shift
case "$(uname -s 2>/dev/null || true)" in
MINGW*|MSYS*|CYGWIN*)
is_windows_shell=1
;;
esac
if [ "$is_windows_shell" -eq 1 ]; then
cmd_path=$(where.exe "$cmd" 2>/dev/null | tr -d '\r' | grep -iE '\.cmd$' | head -n 1)
if [ -n "$cmd_path" ]; then
if command -v cygpath >/dev/null 2>&1; then
cmd_path=$(cygpath -u "$cmd_path")
fi
"$cmd_path" "$@"
return
fi
fi
if command -v "$cmd" >/dev/null 2>&1; then
"$cmd" "$@"
return
fi
if command -v "${cmd}.exe" >/dev/null 2>&1; then
"${cmd}.exe" "$@"
return
fi
echo "Error: '$cmd' command not found"
exit 1
}
echo "📦 Building extension..."
run_command npm run compile
echo ""
echo "📋 Packaging extension..."
run_command npx @vscode/vsce package
# Find the latest .vsix file
vsix_file=$(ls -t *.vsix 2>/dev/null | head -n 1)
if [ -z "$vsix_file" ]; then
echo "Error: No .vsix file found after packaging"
exit 1
fi
echo ""
echo "🚀 Installing $vsix_file..."
run_command code --install-extension "$vsix_file" --force
echo ""
echo "Done! Run 'Developer: Reload Window' in VS Code: to apply changes."