dotfiles/playbooks/roles/vscode/templates/update.sh.j2
Matej Focko 937c3f6263
Fix VSCode installation
Closes #7

Signed-off-by: Matej Focko <me@mfocko.xyz>
2020-10-11 20:24:43 +02:00

31 lines
906 B
Django/Jinja

#!/bin/bash
# for upstream
URL='https://go.microsoft.com/fwlink/?LinkId=723968'
# for local
# URL='https://gauss.mfocko.xyz/code-insiders.tar.gz'
# for local over VPN (also use --no-check-certificate)
# URL='https://10.0.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