I am currently trying to write a batch file to build my project in Windows. The project is built with Stylus. Stylus was installed with node.js and the -g flag
Whenever I run my batch file with the stylus command, no commands after the stylus call are executed. It's like the completion of the stylus call forces a window close, even though running the command by itself does not close the window.
Here is my script:
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
pause
Neither the copy command nor the pause command are being executed. If I comment out the stylus command, they are executed. The stylus command is outputting the files, so I am at a loss.
Does anyone kinow why stylus execution forces my script to end execution?
stylus
is most likely a batch file. You have to call other batch files with call
, otherwise control won't return to the calling batch:
call stylus -c ...