11@ echo off
22setlocal enabledelayedexpansion
33
4- rem Function to check if a command was successful
4+ :: Define colors for output
5+ set " GREEN = [92m"
6+ set " RED = [91m"
7+ set " NC = [0m"
8+
9+ :: Function to print colored output
10+ :print_color
11+ echo %~1%~2 %NC%
12+ exit /b
13+
14+ :: Function to check if a command was successful
515:check_success
616if %errorlevel% equ 0 (
7- echo %~1
17+ call : print_color " %GREEN% " " ✔ %~1 "
818) else (
9- echo %~1
19+ call : print_color " %RED% " " ✘ %~1 "
1020 exit /b 1
1121)
1222exit /b 0
1323
14- rem Main installation process
24+ :: Main installation process
1525:main
16- echo Starting CodeQuill manager installation...
26+ call : print_color " %GREEN% " " Starting CodeQuill manager installation..."
1727
18- rem Navigate to user profile directory
28+ :: Navigate to user profile directory
1929cd %USERPROFILE%
2030call :check_success " Changed to user profile directory"
2131
22- rem Download the installation script
32+ :: Download the installation script
2333powershell -Command " (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/The-Best-Codes/codequill/main/.device_scripts/codequill.bat', 'codequill.bat')"
2434if errorlevel 1 (
25- echo Failed to download installation script
35+ call : print_color " %RED% " " Failed to download installation script"
2636 exit /b 1
2737)
2838call :check_success " Downloaded installation script"
2939
30- rem Run the installation script
40+ :: Run the installation script
3141call codequill.bat
3242if errorlevel 1 (
33- echo Failed to run installation script
43+ call : print_color " %RED% " " Failed to run installation script"
3444 exit /b 1
3545)
3646call :check_success " Ran installation script"
3747
38- echo CodeQuill manager installation complete!
48+ call : print_color " %GREEN% " " CodeQuill manager installation complete!"
3949exit /b 0
4050
41- rem Run the main function
51+ :: Run the main function
4252call :main
4353
44- rem Keep the command prompt open until a key is pressed
54+ :: Keep the command prompt open until a key is pressed
4555echo .
46- echo Press any key to exit.
56+ call : print_color " %GREEN% " " Press any key to exit."
4757pause > nul
0 commit comments