Skip to content

Commit

Permalink
update setup script to prompt new users
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberHoward committed Nov 9, 2023
1 parent c79ad79 commit 021dac2
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions template-setup.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,36 @@

mv example.env .env

# Delete this script after running
rm -- "$0"
# Function to prompt for 'y' input
prompt_confirmation() {
local prompt_message="$1"
read -p "$prompt_message (y/n): " -n 1 -r
echo # Move to a new line
[[ $REPLY =~ ^[Yy]$ ]]
}

# Check if 'just' command is available
if ! command -v just &> /dev/null
then
echo "'just' command not found. 🤨"

# Ask to install 'just'
if prompt_confirmation "Do you want to install the 'just' command runner?"
then
cargo install just
echo "'just' has been installed."
else
echo "Installation of 'just' cancelled. Can't install tools. ❌"
exit 1
fi
fi

# Ask to install tools using 'just'
if prompt_confirmation "Do you want to install tools (cargo-nextest, taplo-cli, cargo-watch, cargo-limit)?"
then
just install-tools
echo "Tools have been installed! 👷"
else
echo "Tools installation cancelled. ❌"
exit 1
fi

0 comments on commit 021dac2

Please sign in to comment.