PortValhalla/scripts/PopOS/software/code.sh

23 lines
592 B
Bash
Raw Normal View History

2022-11-12 03:15:44 +00:00
#!/bin/bash
# Elevate script
if [ ! "$UID" -eq 0 ]
then
2022-11-13 00:11:32 +00:00
sudo bash "$BASH_SOURCE"
else
apt install -y wget gpg
keyFile=$(mktemp)
2022-11-12 03:15:44 +00:00
2022-11-13 00:11:32 +00:00
wget -qO- https://packages.microsoft.com/keys/microsoft.asc \
| gpg --dearmor > $keyFile
2022-11-12 03:15:44 +00:00
2022-11-13 00:11:32 +00:00
install -D -o root -g root -m 644 $keyFile /etc/apt/keyrings/packages.microsoft.gpg
2022-11-12 03:15:44 +00:00
2022-11-13 00:11:32 +00:00
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
2022-11-12 03:15:44 +00:00
2022-11-13 00:11:32 +00:00
rm -f $keyFile
2022-11-13 00:12:31 +00:00
apt update
apt install -y code
2022-11-13 00:11:32 +00:00
fi