testsAndMisc/linux_configuration/scripts/single_use/install_code_insiders.sh
Krzysztof kuhy Rudnicki 42a66a1419 refactor(linux_configuration/scripts): split all scripts into single_use/ and periodic_background/
- Move all linux_configuration scripts into two semantic categories:
  - single_use/: scripts run once manually (fresh install, fixes, setup)
  - periodic_background/: scripts run by systemd timers or daemons
- Preserve existing subdirectory structure within each category
- Fix lib/common.sh source paths for new directory depths
- Fix CONFIG_DIR depth in setup_periodic_system.sh and check_and_enable_services.sh
- Update all references in tests, fresh-install/main.sh, nix modules, and docs
- Fix check_polling_antipatterns.sh false positives (||, regex |, case patterns, jq strings)
- Fix pre-existing mypy exclusion path and type annotations for moved tools/ directory
- Rewrite check_polling_antipatterns.sh using awk (no bash regex loops); add require_serial: true
2026-05-15 00:32:35 +02:00

33 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Sets up Microsoft's APT repository and installs the latest VS Code Insiders.
# Re-running this script is safe — it will update to the newest version.
set -euo pipefail
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root (use sudo)." >&2
exit 1
fi
echo "==> Installing prerequisites..."
apt-get update -qq
apt-get install -y -qq wget gpg apt-transport-https
KEYRING=/usr/share/keyrings/microsoft-archive-keyring.gpg
SOURCES_LIST=/etc/apt/sources.list.d/vscode.list
echo "==> Adding Microsoft GPG key..."
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o "$KEYRING" --yes
echo "==> Adding VS Code repository..."
echo "deb [arch=amd64,arm64,armhf signed-by=${KEYRING}] https://packages.microsoft.com/repos/code stable main" \
> "$SOURCES_LIST"
echo "==> Updating package lists..."
apt-get update -qq
echo "==> Installing code-insiders..."
apt-get install -y code-insiders
echo "==> Done. Installed version:"
code-insiders --version 2>/dev/null || echo "(run 'code-insiders --version' to verify)"