Workspace-rule for removing a directory

Hi,
what is the right workspace-rule for deleting a directory on the server-workspace?

  • "/Dir_to_delete/ << /InvalidDirName"

or

  • "/Dir_to_delete/ << /"

or none of them?

Both are working but I don't know whate side-effects they can have.

Sorry, correction.
None of them worked. Both removed the directory but both raised in “Agent To Server Workspace Sync” a exception “An error occurred while syncing files from the server to the agent. Details: Exception: NullReferenceException”.

Is there a other rule with which I can remove directories?

Hi Rynardald,

There isn’t a rule especially for deleting workspace folders. The << rule operator deletes the destination folder before copying the files from the source folder.  

In our tests, the second rule does indeed raise a NullReferenceException exception. There will be a fix for this in the next version.

However, the first rule has the desired effect in our tests.

/Dir_to_delete/ << /InvalidDirName

removes Dir_to_delete as required. If this is not working for you, can you send the build log for this rule to support@finalbuilder.com. Turn on the “Log workspace files copies” option in each stage before running the build so we can see what is happening in the log.

In the mean time, you may be able to get this working by changing the rule to:

/Dir_to_delete/ << /InvalidDirName**