PortValhalla/scripts/PopOS/software/code.sh

19 lines
512 B
Bash

#!/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