-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·49 lines (38 loc) · 1.35 KB
/
install.sh
File metadata and controls
executable file
·49 lines (38 loc) · 1.35 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
#!/bin/bash
set -e
REPO="stuffbucket/vscode-lima"
EXTENSION_NAME="lima-manager"
echo "Installing Lima Manager VS Code Extension..."
# Detect OS and set VS Code command
if command -v code &> /dev/null; then
VSCODE_CMD="code"
elif [[ "$OSTYPE" == "darwin"* ]] && [[ -d "/Applications/Visual Studio Code.app" ]]; then
VSCODE_CMD="/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"
else
echo "Error: VS Code not found"
echo "Install VS Code from https://code.visualstudio.com/"
exit 1
fi
# Check if VS Code is installed
if ! command -v $VSCODE_CMD &> /dev/null; then
echo "Error: VS Code command 'code' not found in PATH"
echo "Install VS Code or add it to your PATH first"
exit 1
fi
# Create temp directory
TMP_DIR=$(mktemp -d)
trap "rm -rf $TMP_DIR" EXIT
cd "$TMP_DIR"
# Download latest release
echo "Downloading latest release..."
LATEST_URL=$(curl -sL "https://api.github.com/repos/$REPO/releases/latest" | grep "browser_download_url.*vsix" | cut -d '"' -f 4)
if [ -z "$LATEST_URL" ]; then
echo "Error: Could not find .vsix file in latest release"
exit 1
fi
curl -sL "$LATEST_URL" -o "$EXTENSION_NAME.vsix"
# Install extension
echo "Installing extension..."
$VSCODE_CMD --install-extension "$EXTENSION_NAME.vsix"
echo "✓ Lima Manager installed successfully!"
echo "Restart VS Code to activate the extension"