Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/template setup script #179

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions app-template/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