我目前正在尝试编写一个批处理文件,以便在Windows中构建我的项目。该项目是使用Stylus构建的。手写笔安装时带有node.js和-g标志
每当我使用手写笔命令运行我的批处理文件时,在手写笔调用之后没有执行任何命令。这就像完成手写笔调用会强制关闭窗口一样,即使单独运行该命令并不会关闭窗口。
下面是我的脚本:
set sourcedir="d:\Projects\Travnet\Web\source"
set destdir="d:\Projects\Travnet\Web\package"
::clean up the lackage dir
rmdir /q /s %destdir%
md %destdir%
:: Duplicate all images for the package
xcopy %sourcedir%\assets\img\* %destdir%\img\ /y
::compress the stylus css
::-c is the source, -o is the output dir
if not exist %destdir%\css md %destdir%\css
stylus -c %sourcedir%\assets\styl -o %destdir%\css
::type %destdir%\css\* > %destdir%\css\styles.css
copy /b %destdir%\css\* %destdir%\css\styles.css
pausecopy命令和pause命令均未执行。如果我注释掉了手写笔命令,它们就会被执行。手写笔命令是输出文件,所以我很困惑。
有人知道为什么手写笔执行会迫使我的脚本结束执行吗?
发布于 2012-07-27 00:53:22
stylus很可能是一个批处理文件。必须使用call调用其他批处理文件,否则控制不会返回到调用的批处理:
call stylus -c ...https://stackoverflow.com/questions/11674177
复制相似问题