Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
Features(#27): WIN: add log highlight in install.win.bat (#37)
Browse files Browse the repository at this point in the history
* add tool:  sky-install.win.bat

* fix |> add tool: sky-install.win.bat

* update

* update

* add tool:install.win.bat

* Update install.win.bat

* Delete tools/sky-install.win.bat

---------

Co-authored-by: SPeak <[email protected]>
  • Loading branch information
sky-littlestar and Sunrisepeak authored Aug 22, 2024
1 parent 9812f96 commit 273c844
Showing 1 changed file with 52 additions and 19 deletions.
71 changes: 52 additions & 19 deletions tools/install.win.bat
Original file line number Diff line number Diff line change
@@ -1,47 +1,80 @@
@echo off
@Echo off
Setlocal
::EchoANSI.cmd
cls
:: Display a sample of all the ANSI colours.
:: Requires windows 1909 or newer

REM set ansi color - TODO: support log-color
set "RED=%ESC%[31m"
set "GREEN=%ESC%[32m"
set "YELLOW=%ESC%[33m"
set "PURPLE=%ESC%[35m"
set "CYAN=%ESC%[36m"
set "RESET=%ESC%[0m"
:: Define foreground and background ANSI colors:
Set _FBLACK=
Set _BBLACK=
Set _FRED=
Set _BRED=
Set _FGREEN=
Set _BGREEN=
Set _FYELLOW=
Set _BYELLOW=
Set _FBLUE=
Set _BBLUE=
Set _FMAG=
Set _BMAG=
Set _FCYAN=
Set _BCYAN=
Set _FLGRAY=
Set _BLGRAY=
Set _FDGRAY=
Set _BDGRAY=
Set _FBRED=
Set _BBRED=
Set _FBGREEN=
Set _BBGREEN=
Set _FBYELLOW=
Set _BBYELLOW=
Set _FBBLUE=
Set _BBBLUE=
Set _FBMAG=
Set _BBMAG=
Set _FBCYAN=
Set _BBCYAN=
Set _FBWHITE=
Set _BBWHITE=
Set _RESET=

echo [d2ds]: start detect environment and try to auto config...
echo %_FBMAG%[d2ds]: start detect environment and try to auto config...

REM Check if xmake is installed
where xmake >nul 2>&1

IF %ERRORLEVEL% EQU 0 (
echo [d2ds]: xmake installed
echo %_FBGREEN%[d2ds]: xmake installed
) else (
REM xmake is not installed, downloading and running install script using PowerShell
echo [d2ds]: start install xmake...
echo %_FBMAG%[d2ds]: start install xmake...%_RESET%
powershell -Command "Invoke-Expression ((Invoke-WebRequest 'https://xmake.io/psget.text' -UseBasicParsing).Content)"
)

REM Check if the extension is already installed
code --list-extensions | findstr /I /C:"ms-vscode.cpptools" >nul
if %ERRORLEVEL% equ 0 (
echo [d2ds]: vscode c++ extension installed
echo %_FBGREEN%[d2ds]: vscode c++ extension installed
) else (
echo [d2ds]: start install vscode c++ extension...
echo %_FBMAG%[d2ds]: start install vscode c++ extension...%_RESET%
call code --install-extension ms-vscode.cpptools
)

REM Colored echo
echo [d2ds]: auto config done.
echo %_FBMAG%[d2ds]: auto config done.
echo.
echo Dive into Data Structures pre-v0.0.1 - open-sources
echo %_FYELLOW% Dive into Data Structures pre-v0.0.1 - open-sources
echo.
Echo %_FCYAN%
echo - main-repo: https://github.com/Sunrisepeak/d2ds
echo - ebook: https://sunrisepeak.github.io/d2ds
echo - courses: https://sunrisepeak.github.io/d2ds-courses
echo - dstruct: https://github.com/Sunrisepeak/dstruct
echo - issues: https://github.com/Sunrisepeak/d2ds/issues
echo.
echo [d2ds]: Try running xmake dslings to start your d2ds coding...
echo [d2ds]: run xmake d2ds get more info
Echo %_RESET%
echo [d2ds]: Try running %_FRED%xmake dslings%_RESET% to start your d2ds coding...
echo [d2ds]: run %_FRED%xmake d2ds%_RESET% get more info

:END
:END

0 comments on commit 273c844

Please sign in to comment.