我对批处理不是很熟悉,但我发现这是将我网站上的.less文件编译成.css的好方法。
然而,在批处理文件中使用for
循环查找所有.less文件并将它们编译为相应的.css文件后,我的脚本停止执行,尽管在for
循环之后我有更多的命令。
我的批处理脚本包含以下内容:
@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!
当我运行这个脚本时,输出显示所有的.less编译过程,但是"reached the end of the batch script!"字符串从未被显示,因此,在.less编译之后我想要执行的任何操作都没有发生。
为什么在for循环中.less编译之后的任何脚本都没有被执行?