I need to run this command from ant:
pylint -f parseable src/apps/api | tee pylint.out
It outputs a pylint.out file.
I tried this:
<target name="pylint" description="Pylint">
<exec executable="pylint">
<arg line="-f parseable src/apps/api | tee ${basedir}/pylint.out"/>
</exec>
</target>
But that doesn’t produce the pylint.out file. Any ideas?
It seems that ant will treat your pipe (
|) as an argument rather than a command to the shell.One solution would be to extract your command to a script:
pylint.sh:
and then run that script from the
<exec>task:build.xml:
That’s obviously not cross-platform and there may be a better way that I haven’t thought of, but you could have an equivalent
.batfile and do OS-detection in ANT to make it work on Windows if needed.