Search code examples
nantstdoutstdinminify

NAnt exec doesn't work with stdin redirection?


I'm trying to use jsmin with nant - and it just uses stdin and stdout for input and output. The nant 'exec' task allows you to redirect the output to a file, but not get the input from a file.

I have tried with a 'commandline' using '>' and '<' to direct the input and output, but nant just goes away and doesn't come back :(

I can't believe no-one's tried to do this before. Please help! :)


Solution

  • From http://www.mail-archive.com/[email protected]/msg04575.html. You should be able to do something similar to:

            <exec program="cmd.exe" workingdir=".">
                    <arg value="/c cacls" />
                    <arg value="${mdb.file}" />
                    <arg value="/E" />
                    <arg value="/G testpc\aspnet:F" />
                    <arg value="&lt; y.txt" />
            </exec>