dotfiles/playbooks/roles/vscode/templates/update.sh.j2
Matej Focko 8dea4557f5
fix(vscode): Fix URLs and IP in update script
Fixes #32

Signed-off-by: Matej Focko <mfocko@redhat.com>
2021-08-29 16:20:23 +02:00

31 lines
931 B
Django/Jinja

#!/bin/bash
# for upstream
URL='https://code.visualstudio.com/sha/download?build=insider&os=linux-x64'
# for local
# URL='https://gauss.mfocko.xyz/code-insiders.tar.gz'
# for local over VPN (also use --no-check-certificate)
# URL='https://172.16.0.2/code-insiders.tar.gz'
echo ">>> Downloading";
wget $URL -O /tmp/code.tar.gz
echo ">>> Removing and extracting";
rm -rf /opt/VSCode-linux-x64
tar xvaf /tmp/code.tar.gz -C /opt/
# Check for binaries
if ! [ -x /usr/local/bin/code-insiders ]; then
echo ">>> Linking binaries";
ln -s /opt/VSCode-linux-x64/bin/code-insiders /usr/local/bin/
ln -s /opt/VSCode-linux-x64/bin/code-insiders /usr/local/bin/code
fi
# Check for *.desktop
if ! ls /usr/share/applications | grep visual-studio-code; then
echo ">>> Installing desktop files";
PATH_TO_APPS=/home/mfocko/.local/share/visual-studio-code-insiders
sudo cp $PATH_TO_APPS{,-url-handler}.desktop /usr/share/applications/;
fi