View Single Post
  #2  
Old 01-26-2006, 02:48 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,027
For the create case, conditionally build the step only if the folder doesn't exist. See the Create dest dir step of the Recurse.bld sample.

In the delete case, testing here on Windows XP SP2 (with %DOSCMD% resolving to C:\WINDOWS\system32\cmd.exe /C), that command does return a 0 (success) exit code if no matching files are found, but if it does something different in your environment, you could treat a failure with output containing 'does not exist' as success by adding (VBScript) code like this to the step's vbld_StepDone script event function:

If InStr(Application.ExpandMacros("%LASTSTEP_OUTPUT%" ), "does not exist") Then
Step.BuildStatus = vbldStepStatSucceeded
End If

See help on script events for more details: http://www.visualbuild.com/Manual/?scriptevents.htm
Reply With Quote