-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9095c5b
commit 3386d2a
Showing
2 changed files
with
36 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,39 @@ | ||
@echo off | ||
setlocal EnableDelayedExpansion | ||
|
||
set slug=%~1 | ||
set processed_name=%~2 | ||
cd.. | ||
set configPath=config.json | ||
|
||
cd exercises | ||
cd practice | ||
cd %slug% | ||
call %processed_name%Test.bat test-runner | ||
for /f "usebackq tokens=*" %%a in ("%configPath%") do ( | ||
set "line=%%a" | ||
|
||
REM Look for lines containing the slug | ||
echo !line! | findstr /c:"\"slug\"" >nul | ||
if !errorlevel! equ 0 ( | ||
set "_slug=!line:*\"slug\": \"=!" | ||
set "_slug=!_slug:\"",=!" | ||
set "_slug=!_slug:\"",=!" | ||
) | ||
|
||
REM Look for lines containing the name | ||
echo !line! | findstr /c:"\"name\"" >nul | ||
if !errorlevel! equ 0 ( | ||
set "_name=!line:*\"name\": \"=!" | ||
set "_name=!_name:\"",=!" | ||
set "_name=!_name:\"",=!" | ||
for /f "tokens=2 delims=:" %%a in ('echo !_slug!') do set "slug=%%a" | ||
set "slug=!slug:~2,-2!" | ||
for /f "tokens=2 delims=:" %%a in ('echo !_name!') do set "name=%%a" | ||
set "name=!name:~2,-2!" | ||
|
||
|
||
echo Slug: !slug! | ||
echo Name: !name! | ||
echo Exec: call exercises/practice/!slug!/!name: =!Test.bat test-runner | ||
call exercises/practice/!slug!/!name: =!Test.bat test-runner | ||
echo. | ||
|
||
) | ||
) | ||
|
||
endlocal |
This file was deleted.
Oops, something went wrong.