@@ -7,12 +7,19 @@ NC='\033[0m' # No Color
77
88# Update package list
99echo " Updating package list (you may need to authenticate)..."
10- apt update
11- apt install -y curl
10+ if ! sudo apt update; then
11+ echo -e " ${RED} Failed to update package list${NC} "
12+ exit 1
13+ fi
14+
15+ if ! sudo apt install -y curl; then
16+ echo -e " ${RED} Failed to install curl${NC} "
17+ exit 1
18+ fi
1219
1320# Function to print colored output
1421print_color () {
15- printf " ${1}${2}${ NC} \n"
22+ printf " ${1} %b ${ NC} \n" " $2 "
1623}
1724
1825# Function to check if a command was successful
@@ -34,19 +41,32 @@ main() {
3441 check_success " Changed to home directory"
3542
3643 # Download the installation script
37- curl -O https://raw.githubusercontent.com/The-Best-Codes/codequill/main/.device_scripts/codequill.sh
44+ if ! curl -O https://raw.githubusercontent.com/The-Best-Codes/codequill/main/.device_scripts/codequill.sh; then
45+ print_color " ${RED} " " Failed to download installation script"
46+ exit 1
47+ fi
3848 check_success " Downloaded installation script"
3949
4050 # Make the script executable
41- chmod +x codequill.sh
51+ if ! sudo chmod +x codequill.sh; then
52+ print_color " ${RED} " " Failed to make script executable"
53+ exit 1
54+ fi
4255 check_success " Made script executable"
4356
4457 # Run the installation script
45- ./codequill.sh
58+ if ! ./codequill.sh; then
59+ print_color " ${RED} " " Failed to run installation script"
60+ exit 1
61+ fi
4662 check_success " Ran installation script"
4763
4864 print_color " ${GREEN} " " CodeQuill manager installation complete!"
4965}
5066
5167# Run the main function
5268main
69+
70+ # Keep the terminal open until Ctrl+C is pressed
71+ echo -e " ${GREEN} Press Ctrl+C to exit.${NC} "
72+ trap : TERM INT; sleep infinity & wait
0 commit comments