Add a script for installing vscode

This commit is contained in:
Manuel Thalmann 2022-11-12 04:15:44 +01:00
parent f8c4781037
commit e8023042fb

View file

@ -0,0 +1,19 @@
#!/bin/bash
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
apt-get install wget gpg
keyFile=$(mktemp)
wget -qO- https://packages.microsoft.com/keys/microsoft.asc \
| gpg --dearmor > $keyFile
install -D -o root -g root -m 644 $keyFile /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" \
| tee /etc/apt/sources.list.d/vscode.list
rm -f $keyFile