-
Notifications
You must be signed in to change notification settings - Fork 0
/
00_Env_Check.bat
40 lines (33 loc) · 1.01 KB
/
00_Env_Check.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@echo off
setlocal enabledelayedexpansion
echo [94m----------------------------[0m
echo [94mVerify command installation.[0m
echo [94m----------------------------[0m
REM check list.
set "commands=java mvn quasar npm aws"
REM version command.
set "version_options=java:-version mvn:-v quasar:--version npm:-v aws:--version not_found:--version"
REM command check.
for %%i in (%commands%) do (
set "version_option="
for %%v in (%version_options%) do (
for /f "tokens=1,2 delims=:" %%a in ("%%v") do (
if "%%a"=="%%i" set "version_option=%%b"
)
)
where "%%i" >nul 2>&1
if not errorlevel 1 (
echo [32mINSTALLED %%i[0m
set "version_info="
for /f "delims=" %%x in ('%%i !version_option! 2^>^&1') do (
if "!version_info!"=="" (
echo %%x
) else (
echo %%x
)
)
) else (
echo [91m[1m[7mNOT INSTALLED %%i[0m
)
)
cmd /k echo end file.