I'm new to batch, but I figured out it would be a good way to compile the .less files for my website into .css before deploying it.
Unfortunately, after I use a for
loop in a batch file to find all of my .less files and compile them into their .css equivalents, my script stops execution even though I have more commands after the for
loop.
My batch script contains the following:
@echo off
rmdir c:\code\releaseDirectory /s /q
echo d | xcopy /d c:\code\devDirectory c:\code\releaseDirectory /s
cd c:\code\releaseDirectory
for /r %%i in (*.less) do echo %%i
for /r %%i in (*.less) do lessc -x %%i > %%~pi%%~ni.css
echo reached the end of the batch script!
When I run this, the output shows all of the .less compiling happening, but the "reached the end of the batch script!" string never get displayed and thus, and any actions I want to take after the .less compilation never happen.
Why isn't any script after the less compilation in the for
loop being executed?