Skip to content

Commit

Permalink
Add version of runBearer script that works on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
davewichers committed Jan 23, 2025
1 parent b25801a commit 00931b7
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scripts/runBearer_onWindows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@echo off
REM Check for install/updates at https://github.com/bearer/bearer

where docker >nul 2>nul
IF %ERRORLEVEL% NEQ 0 (
@echo docker required. Please install.
exit /b
)

where sh >nul 2>nul
IF %ERRORLEVEL% NEQ 0 (
@echo git bash is required. Please install.
exit /b
)

docker pull bearer/bearer

for /f %%i in ('sh scripts/getBenchmarkVersion.sh') do set benchmark_version=%%i
for /f %%i in ('docker run bearer/bearer bearer --version ^| grep -o "[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+"') do set bearer_version=%%i
set result_file="/src/results/Benchmark_%benchmark_version%-Bearer-v%bearer_version%.json"
set current_dir=%cd%

@echo on
docker run --rm -v "%current_dir%:/src" bearer/bearer scan /src/src/main/ --format jsonv2 --output %result_file%

0 comments on commit 00931b7

Please sign in to comment.