Avoiding console output when running an <exec/> task

View: New views
3 Messages — Rating Filter:   Alert me  

Avoiding console output when running an <exec/> task

by Chris Lambrou-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
 
I'm using the exec task to generate a Subversion log file for my current checkout folder, which I would normally do from the command line as follows:
 
svn.exe log >svn.log
 
Note that the Subversion log file is obtained by redirecting the standard output of svn.exe to a file. I can achieve the same effect with the NAnt exec task by setting the task's output property, like this:
 
<exec program="svn.exe" commandline="log" output="svn.log"/>
 
The problem is that the exec task echoes all of the output from the svn.exe command to the NAnt console, which fills my NAnt console and log file with cruft. Does anyone know how to avoid this?
 
Chris

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users

Re: Avoiding console output when running an <exec/> task

by gertdriesen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Chris,

 

Currently this is not possible. However, I’m strongly considering changing this behavior (even if this is a breaking change).

 

Gert

 

From: nant-users-bounces@... [mailto:nant-users-bounces@...] On Behalf Of Chris Lambrou
Sent: woensdag 2 juli 2008 18:02
To: nant-users@...
Subject: [NAnt-users] Avoiding console output when running an <exec/> task

 

Hi,

 

I'm using the exec task to generate a Subversion log file for my current checkout folder, which I would normally do from the command line as follows:

 

svn.exe log >svn.log

 

Note that the Subversion log file is obtained by redirecting the standard output of svn.exe to a file. I can achieve the same effect with the NAnt exec task by setting the task's output property, like this:

 

<exec program="svn.exe" commandline="log" output="svn.log"/>

 

The problem is that the exec task echoes all of the output from the svn.exe command to the NAnt console, which fills my NAnt console and log file with cruft. Does anyone know how to avoid this?

 

Chris


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users

Re: Avoiding console output when running an <exec/>task

by Roebuck, Alex :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

There is a workaround, but it’s a bit messy.  You can execute your command indirectly via the command shell and pipe the output to your log file. 

 

E.g.:

 

<exec program="C:\WINDOWS\system32\cmd.exe" commandline="/C svn.exe log &gt; svn.log"/>

 

Regards,

 

Alex.

 

 

From: nant-users-bounces@... [mailto:nant-users-bounces@...] On Behalf Of Gert Driesen
Sent: Wednesday, July 02, 2008 7:09 PM
To: 'Chris Lambrou'; nant-users@...
Subject: Re: [NAnt-users] Avoiding console output when running an <exec/>task

 

Chris,

 

Currently this is not possible. However, I’m strongly considering changing this behavior (even if this is a breaking change).

 

Gert

 

From: nant-users-bounces@... [mailto:nant-users-bounces@...] On Behalf Of Chris Lambrou
Sent: woensdag 2 juli 2008 18:02
To: nant-users@...
Subject: [NAnt-users] Avoiding console output when running an <exec/> task

 

Hi,

 

I'm using the exec task to generate a Subversion log file for my current checkout folder, which I would normally do from the command line as follows:

 

svn.exe log >svn.log

 

Note that the Subversion log file is obtained by redirecting the standard output of svn.exe to a file. I can achieve the same effect with the NAnt exec task by setting the task's output property, like this:

 

<exec program="svn.exe" commandline="log" output="svn.log"/>

 

The problem is that the exec task echoes all of the output from the svn.exe command to the NAnt console, which fills my NAnt console and log file with cruft. Does anyone know how to avoid this?

 

Chris


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users