Nant - check if remote access already exists

We use Nant to deploy the application and must ensure that the share is created during the process.

We use psexecit net shareto create a shared resource, but it fails and stops Nant if this resource already exists.

Is there a way to detect that share already exists?

Either before trying to create a shared resource, or with the ability to detect a return code 2or message The name has already been sharedfrom psexec?

I tried directory::exists, but it always returns false.

I tried to copy the file to a remote directory and file::exists, but that always returns false.

+3
source share
1 answer

It seems that I am doing something wrong with my variables and paths:

<echo message="exists!" if="${directory::exists('\\${server}\share')}"/>

does not work however:

<property name="test" value="\\${server}\share" />
<echo message="exists!" if="${directory::exists(test)}"/>

works great!

+3
source

Source: https://habr.com/ru/post/1753272/


All Articles