#!/bin/bash
echo "⚠️  WARNING: This script is untested against all but @benburton's machine."
echo "            It will install the foxglove binary to ~/.foxglove."
echo "            Please take a look at the source before running it to make sure"
echo "            you're comfortable with what it's doing!"
echo
echo "            https://github.com/theorchard/collab/blob/master/bburton/foxglove/install.sh"
echo

read -e -p "Feeling confident? (y/n)? " ANSWER
if [ "$ANSWER" != "y" ] ;then 
    echo "Probably a good call, tbh."
    exit
fi

if ! [ -d ~/.foxglove ]; then
    mkdir -p ~/.foxglove
fi;

echo
echo "Compiling..."
bun compile
cp build/foxglove ~/.foxglove/
echo

echo "Installed to ~/.foxglove"
echo

echo "To add to your path:"
echo "    export PATH="/Users/$USER/.foxglove:\$PATH" >> ~/.zshrc"