batch-filecmdlessc

Batch file call lessc not returning control despite executing successfully


I have this batch file but can't get it to return control after chaining commands:

set hostingDir=%cd%
cd "%hostingDir%\MVC\wwwroot
call webpack --config webpack.config.js --stats=summary

cd "%hostingDir%\MVC\wwwroot\styles"

REM Compile LESS files
call "E:\Node\lessc" --glob --source-map --clean-css "style.less" "style.min.css"^
&& "E:\Node\lessc" --glob --source-map --clean-css "style-below.less" "style-below.min.css"
 
REM Return to base directory -- don't get to here
cd %hostingDir%

PAUSE

However, if I remove the chaining and call lessc on only either of the 2 less files, the entire script executes. So I know there is nothing wrong with the less files themselves. I deleted the compiled files and ran again to make sure they compile and they do. Even with both commands chained together.


Solution

  • Two problems.