JD.
JD.

Reputation: 2487

How to make <exec "cp" exclude .svn files in ANT?

I have this ant talk to copy cgi-dir to cgi-dest.

    <exec executable="cp" failonerror="yes">
        <arg value="-a" />
        <arg value="${cgi-dir}" />
        <arg value="${cgi-dest}" />
    </exec>

I chose this method over the "copy" ant task because I wanted to preserve permissions. The ant task explicitly can't.

The problem is that it copies all the .svn directories it sees, how can I prevent this?

Upvotes: 0

Views: 1300

Answers (1)

Pulak Agrawal
Pulak Agrawal

Reputation: 2481

Well.. you can look here, here or here .

This will work I think: tar --exclude='.svn' -c -f - /path/to/sourcedir/* | (cd /path/to/destdir ; tar xfp -)

PS : These existing answers automatically appear as suggestions on the right hand side under "Related" and also when you are typing the subject to your question (it appears you are new to Stack Exchange).

Nevertheless, good luck.

Upvotes: 2

Related Questions