#!/usr/bin/env bash# SCRIPT VERSIONUSER_SETUP_VER=2USER_SETUP_VER_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/ublue/vscode-configured"USER_SETUP_VER_RAN=$(cat "$USER_SETUP_VER_FILE")mkdir -p "$(dirname "$USER_SETUP_VER_FILE")" || exit 1USER_SETUP_VER_FILE_V1="$HOME/.aurora-vscode-configured"# Upgrade from v1 to v2 changes only the location of the USER_SETUP_VER.# Exit if v1 file is present.if [[ -f $USER_SETUP_VER_FILE_V1 ]]; thenecho "User setup v1 has already run. Exiting..."rm $USER_SETUP_VER_FILE_V1echo "$USER_SETUP_VER" > "$USER_SETUP_VER_FILE"exit 0fi# Run script if updatedif [[ -f $USER_SETUP_VER_FILE && "$USER_SETUP_VER" = "$USER_SETUP_VER_RAN" ]]; thenecho "User setup v$VER has already run. Exiting..."exit 0fi# Setup VSCode# Pre-install preferred VSCode Extensionscode --install-extension ms-vscode-remote.remote-containerscode --install-extension ms-vscode-remote.remote-sshcode --install-extension ms-azuretools.vscode-containers# Prevent future executionsecho "Writing state file"echo "$USER_SETUP_VER" > "$USER_SETUP_VER_FILE"