#!/usr/bin/env bash

set -e

# Update the apt cache before installing dependencies.  It can be slow, so the install scripts
# don't do it (to avoid doing it more than once).
sudo apt update -y

# Install all dependencies needed to build, run, and test Warp.
"$PWD"/script/linux/install_test_deps

# Install linuxdeploy.
"$PWD"/script/linux/install_linuxdeploy

# Make sure we're authenticated with the gcloud CLI, otherwise SSH integration
# tests won't work.
if [[ -z "$(gcloud auth print-identity-token)" ]]; then
    echo "gcloud CLI authentication missing.  Press enter to continue..."
    read var
    gcloud auth login
fi

echo "✅ Your machine is bootstrapped and ready to go. :)"
