Skip to content

Commit

Permalink
Fix for install confirm function
Browse files Browse the repository at this point in the history
  • Loading branch information
sfaber34 committed Jun 11, 2024
1 parent 28317cf commit b80edb4
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions packages/nextjs/public/runBuidlGuidlClient.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

# TODO: OpenSSL...

# Default values for the options
e="geth"
c="prysm"
Expand Down Expand Up @@ -56,8 +54,8 @@ done
confirm() {
# Loop until a valid response is received
while true; do
read -p "$1 [Y/n]: " response
case $response in
read -r -p "$1 [Y/n]: " response
case "$response" in
[Yy]* ) return 0;; # User confirmed (yes)
[Nn]* ) return 1;; # User denied (no)
* ) echo "Please answer yes or no.";;
Expand All @@ -81,7 +79,7 @@ if [ "$os_name" = "Linux" ]; then
echo -e "\nβœ… Node is installed. Version:"
node -v
else
if confirm "❓ Node is not installed. Do you want to install it?"; then
if confirm "\n❓ Node is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing Node.js"
cd ~
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
Expand All @@ -95,7 +93,7 @@ if [ "$os_name" = "Linux" ]; then
echo -e "\nβœ… NPM is installed. Version:"
npm -v
else
if confirm "❓ NPM is not installed. Do you want to install it?"; then
if confirm "\n❓ NPM is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing NPM"
sudo apt install npm
else
Expand All @@ -107,7 +105,7 @@ if [ "$os_name" = "Linux" ]; then
echo -e "\nβœ… Yarn is installed. Version:"
yarn -v
else
if confirm "❓ Yarn is not installed. Do you want to install it?"; then
if confirm "\n❓ Yarn is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing Yarn"
sudo npm i yarn -g
else
Expand All @@ -119,7 +117,7 @@ if [ "$os_name" = "Linux" ]; then
echo -e "\nβœ… Git is installed. Version:"
git --version
else
if confirm "❓ Git is not installed. Do you want to install it?"; then
if confirm "\n❓ Git is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing Git"
sudo apt-get install git-all -y
else
Expand All @@ -131,7 +129,7 @@ if [ "$os_name" = "Linux" ]; then
echo -e "\nβœ… GNU Make is installed. Version:"
make -v
else
if confirm "❓ GNU Make is not installed. Do you want to install it?"; then
if confirm "\n❓ GNU Make is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing GNU Make"
sudo apt-get install build-essential
else
Expand All @@ -147,7 +145,7 @@ if [ "$os_name" = "Darwin" ]; then
echo -e "\nβœ… Node is installed. Version:"
node -v
else
if confirm "❓ Node is not installed. Do you want to install it?"; then
if confirm "\n❓ Node is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing Node"
brew install node
else
Expand All @@ -159,7 +157,7 @@ if [ "$os_name" = "Darwin" ]; then
echo -e "\nβœ… Yarn is installed. Version:"
yarn -v
else
if confirm "❓ Yarn is not installed. Do you want to install it?"; then
if confirm "\n❓ Yarn is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing Yarn"
brew install yarn
else
Expand All @@ -171,7 +169,7 @@ if [ "$os_name" = "Darwin" ]; then
echo -e "\nGit is installed. Version:"
git --version
else
if confirm "❓ Git is not installed. Do you want to install it?"; then
if confirm "\n❓ Git is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing Git"
brew install git
else
Expand All @@ -183,7 +181,7 @@ if [ "$os_name" = "Darwin" ]; then
echo -e "\nβœ… GNU Make is installed. Version:"
make -v
else
if confirm "❓ GNU Make is not installed. Do you want to install it?"; then
if confirm "\n❓ GNU Make is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing GNU Make"
brew install make
else
Expand All @@ -194,7 +192,7 @@ if [ "$os_name" = "Darwin" ]; then
if command -v gpg >/dev/null 2>&1; then
echo -e "\nβœ… gnupg is installed."
else
if confirm "❓ gnupg is not installed. Do you want to install it?"; then
if confirm "\n❓ gnupg is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing gnupg:"
brew install gnupg
else
Expand All @@ -205,7 +203,7 @@ if [ "$os_name" = "Darwin" ]; then
if perl -MDigest::SHA -e '1' >/dev/null 2>&1; then
echo -e "\nβœ… Perl-Digest-SHA is installed."
else
if confirm "❓ Perl-Digest-SHA is not installed. Do you want to install it?"; then
if confirm "\n❓ Perl-Digest-SHA is not installed. Do you want to install it?"; then
echo -e "\nπŸ’ͺ Installing perl-Digest-SHA"
brew install perl
brew install cpanminus
Expand Down

0 comments on commit b80edb4

Please sign in to comment.