0

Edit: This question has been answered, please scroll down ⬇️

This question is related to Server Fault because I am automating minifying some web files before deploying them to my server.

So I have a batchfile which calls minify like this:
minify "index.html" > "index.html.minified"

Minify basically takes in an html/css/js file from the command line parameter and "minifies" it so it'll be faster to load, then prints the minified output to stdout. I am attempting to save that output to a file, index.html.minified.

But commands after the one above do not execute in the batch file. What I mean is that the execution of the entire batch just stops after I call this command. The file index.html.minified is created correctly, but the commands after it (like echo Done minifying HTML) do not execute and the command window freezes to the point where I have to force it to quit.

How can I get the batchfile to continue executing after attempting to save the output of a program to a file?

Link to the whole batchfile that I created, the part where I call minify is somewhere near the end

1 Answers1

0

Ah, so my answer to this question has been found.

Instead of trying to run the command in the current batchfile directly (minify index.html > index.html.minified), I could rather do it like this cmd /c minify "Y:/wamp/www/index.html" > "Y:/wamp/www/index.html.minified" to run it in a new instance of Command Prompt.

This solution allows the rest of the batchfile to continue execution after the seperate instance is done.