11@ echo off
22setlocal enabledelayedexpansion
33
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
4+ rem Function to check if a command was successful
155:check_success
166if %errorlevel% equ 0 (
17- call : print_color " %GREEN% " " ✔ %~1 "
7+ echo %~1
188) else (
19- call : print_color " %RED% " " ✘ %~1 "
9+ echo %~1
2010 exit /b 1
2111)
2212exit /b 0
2313
24- :: Main installation process
14+ rem Main installation process
2515:main
26- call : print_color " %GREEN% " " Starting CodeQuill manager installation..."
16+ echo Starting CodeQuill manager installation...
2717
28- :: Navigate to user profile directory
18+ rem Navigate to user profile directory
2919cd %USERPROFILE%
3020call :check_success " Changed to user profile directory"
3121
32- :: Download the installation script
22+ rem Download the installation script
3323powershell -Command " (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/The-Best-Codes/codequill/main/.device_scripts/codequill.bat', 'codequill.bat')"
3424if errorlevel 1 (
35- call : print_color " %RED% " " Failed to download installation script"
25+ echo Failed to download installation script
3626 exit /b 1
3727)
3828call :check_success " Downloaded installation script"
3929
40- :: Run the installation script
30+ rem Run the installation script
4131call codequill.bat
4232if errorlevel 1 (
43- call : print_color " %RED% " " Failed to run installation script"
33+ echo Failed to run installation script
4434 exit /b 1
4535)
4636call :check_success " Ran installation script"
4737
48- call : print_color " %GREEN% " " CodeQuill manager installation complete!"
38+ echo CodeQuill manager installation complete!
4939exit /b 0
5040
51- :: Run the main function
41+ rem Run the main function
5242call :main
5343
54- :: Keep the command prompt open until a key is pressed
44+ rem Keep the command prompt open until a key is pressed
5545echo .
56- call : print_color " %GREEN% " " Press any key to exit."
46+ echo Press any key to exit.
5747pause > nul
0 commit comments