#!/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"; DIRECTORY=/home/mfocko/git/mfocko/dotfiles/code-insiders sudo cp $DIRECTORY/*.desktop /usr/share/applications/; fi