Skip to content

Commit 13b9637

Browse files
committed
Add vscode-codegame to installer
1 parent f38054e commit 13b9637

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

install.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,13 @@ Invoke-WebRequest -Uri https://github.com/code-game-project/codegame-cli/release
3838
Expand-Archive -LiteralPath codegame-cli.zip -DestinationPath $InstallDir
3939
rm codegame-cli.zip
4040

41+
42+
if (Get-Command code -ErrorAction SilentlyContinue) {
43+
Write-Host "Installing vscode-codegame..."
44+
Invoke-WebRequest -Uri https://github.com/code-game-project/vscode-codegame/releases/latest/download/codegame.vsix -OutFile .\codegame.vsix
45+
code --uninstall-extension code-game-project.codegame | Out-Null
46+
code --install-extension codegame.vsix
47+
rm codegame.vsix
48+
}
49+
4150
Write-Host "Done." -ForegroundColor Green

install.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ if [[ $os == *"linux"* ]]; then
3838
exit 1
3939
fi
4040
elif [[ $os == *"darwin"* ]]; then
41+
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
4142
if [[ $arch == *"x86"* ]]; then
4243
echo "Detected OS: macOS x86_64"
4344
download "darwin" "amd64"
@@ -78,4 +79,16 @@ fi
7879

7980
rm codegame-cli.tar.gz
8081

82+
if hash code 2>/dev/null; then
83+
echo "Installing CodeGame VS Code extension..."
84+
if hash wget 2>/dev/null; then
85+
wget -q --show-progress https://github.com/code-game-project/vscode-codegame/releases/latest/download/codegame.vsix -O codegame.vsix || exit 1
86+
else
87+
curl -L https://github.com/code-game-project/vscode-codegame/releases/latest/download/codegame.vsix > codegame.vsix || exit 1
88+
fi
89+
code --uninstall-extension code-game-project.codegame &>/dev/null
90+
code --install-extension codegame.vsix || exit 1
91+
rm codegame.vsix
92+
fi
93+
8194
echo "Done."

0 commit comments

Comments
 (0)