2020-10-11 15:09:15 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# for upstream
|
2021-08-29 16:12:16 +02:00
|
|
|
URL='https://code.visualstudio.com/sha/download?build=insider&os=linux-x64'
|
2020-10-11 15:09:15 +02:00
|
|
|
|
|
|
|
# for local
|
2022-08-18 00:08:11 +02:00
|
|
|
# URL='https://maxwell.mfocko.xyz/code-insiders.tar.gz'
|
2020-10-11 15:09:15 +02:00
|
|
|
|
|
|
|
# for local over VPN (also use --no-check-certificate)
|
2021-08-29 16:12:16 +02:00
|
|
|
# URL='https://172.16.0.2/code-insiders.tar.gz'
|
2020-10-11 15:09:15 +02:00
|
|
|
|
|
|
|
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";
|
2020-10-11 20:24:43 +02:00
|
|
|
PATH_TO_APPS=/home/mfocko/.local/share/visual-studio-code-insiders
|
|
|
|
sudo cp $PATH_TO_APPS{,-url-handler}.desktop /usr/share/applications/;
|
2020-10-11 15:09:15 +02:00
|
|
|
fi
|