Please see the nant docs, docs on tasks, go to the exec task. The documentation that you want you want to read is on the resultproperty attribute.
 
Here is link directly to the documentation that you need:
 
http://nant.sourceforge.net/release/latest/help/tasks/exec.html
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ramya Niranjan
Sent: Monday, February 13, 2006 2:53 AM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Environment variable issue.

Hi,
 
I am trying to capture the ERRORLEVEL env variable when a build fails. Ok the scenario is like this. I am trying to execute an MSI build using the exec task and if this fails, then a folder of name <Folder>.Date.Time.WithErrors has to be created and the MSI package with errors has to be copied here. Now the catch is if I set the failonerror attribute to true, then the build stops. And If I set it to false, I do not have a way to track the status. Currently I am doing the entire process in Batch file where I have the %ERRORLEVEL% variable and I can check this value to create the folders accordingly....I tried creating a VB exe of the following type:
 
dim str as string=Environment.GetEnvironmentVariable("ERRORLEVEL")
but this returns null string.
 
Could anybody help me with this? Or has anyone faced this kind of scenario?
 
Thanks,
Niranjan

Reply via email to