#!/usr/bin/env bash

# omarchy:summary=Install the AWS CLI and the awsp profile switcher
# omarchy:requires-sudo=true

# Based: the AWS CLI through asdf, and awsp, the profile switcher, from npm on
# asdf's Node.js so nothing needs root on either OS.

set -eo pipefail

asdf_data=${ASDF_DATA_DIR:-$HOME/.asdf}
omarchy-pkg-add asdf
export PATH="$asdf_data/shims:$PATH"

echo -e "Installing the AWS CLI...\n"
omarchy-dev-env-tool awscli

echo -e "\nInstalling awsp...\n"
omarchy-dev-env-tool nodejs
npm install -g awsp
asdf reshim nodejs
