visual Changes

This commit is contained in:
Gaurav Bankar
2024-08-07 09:00:09 +05:30
parent ec75c01db3
commit 6e41b1721f

View File

@@ -3,7 +3,7 @@
# Color codes # Color codes
RED='\033[0;31m' RED='\033[0;31m'
GREEN='\033[0;32m' GREEN='\033[0;32m'
YELLOW='\033[1;33m' YELLOW='\033[0;33m'
BLUE='\033[0;34m' BLUE='\033[0;34m'
BOLD='\033[1m' BOLD='\033[1m'
NC='\033[0m' # No Color NC='\033[0m' # No Color
@@ -57,10 +57,10 @@ function ask_confirmation {
return 0 # User confirmed return 0 # User confirmed
elif [[ $REPLY =~ ^[Nn]$ ]]; then elif [[ $REPLY =~ ^[Nn]$ ]]; then
log_message "Operation cancelled by user." log_message "Operation cancelled by user."
print_error "Operation cancelled.\n" print_error "Operation cancelled."
return 1 # User cancelled return 1 # User cancelled
else else
print_error "Invalid input. Please answer y or n.\n" print_error "Invalid input. Please answer y or n."
fi fi
done done
} }
@@ -75,8 +75,8 @@ function run_command {
log_message "Attempting to run: $description" log_message "Attempting to run: $description"
if [[ "$ask_confirm" == "yes" ]]; then if [[ "$ask_confirm" == "yes" ]]; then
if ! ask_confirmation "Do you want to $description"; then if ! ask_confirmation "\n$description"; then
print_warning "$description was skipped." print_info "$description was skipped."
log_message "$description was skipped by user choice." log_message "$description was skipped by user choice."
return 1 return 1
fi fi
@@ -116,14 +116,14 @@ function run_command {
function run_script { function run_script {
local script="$SCRIPT_DIR/$1" local script="$SCRIPT_DIR/$1"
local description="$2" local description="$2"
if ask_confirmation "Do you want to execute '$description' script"; then if ask_confirmation "\nExecute '$description' script"; then
while ! bash "$script"; do while ! bash "$script"; do
print_error "$description script failed." print_error "$description script failed."
if ! ask_confirmation "Retry $description"; then if ! ask_confirmation "Retry $description"; then
return 1 # User chose not to retry return 1 # User chose not to retry
fi fi
done done
print_success "\n$description completed successfully.\n" print_success "\n$description completed successfully."
else else
return 1 # User chose not to run the script return 1 # User chose not to run the script
fi fi
@@ -151,7 +151,7 @@ function check_os {
exit 1 exit 1
fi fi
else else
print_success "Arch Linux detected. Proceeding with installation.\n" print_success "Arch Linux detected. Proceeding with installation."
log_message "Arch Linux detected. Installation proceeding." log_message "Arch Linux detected. Installation proceeding."
fi fi
else else