Bash

Bash

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Bash

Post by Tim Blokdijk »

Anybody here that would know how to remove the ".svn" dir (and all files in it) from the current and all sub-directory's with bash?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Code: Select all

find . -name *.svn* | xargs rm -r
User avatar
det
Moderator
Posts: 737
Joined: 26 Nov 2005, 11:22

Post by det »

That will break of any of the directories contain spaces. I would reccomend:

Code: Select all

find -type d -name ".svn" -exec rm -rf "{}" ";"
User avatar
Acidd_UK
Posts: 963
Joined: 23 Apr 2006, 02:15

Post by Acidd_UK »

Just to show off, how about:

Code: Select all

for SVN_DIR in `find . -type d -name .svn`; do rm -rf $SVN_DIR; done
User avatar
det
Moderator
Posts: 737
Joined: 26 Nov 2005, 11:22

Post by det »

That will also break if any of the directories contain spaces :-)
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Post by Auswaschbar »

I dont know what you need it for, but what about "svn export":

Code: Select all

svn export ./ /tmp/svn_without_svn_dirs
Last edited by Auswaschbar on 07 Aug 2007, 17:16, edited 1 time in total.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

[10:58:15 AM] <Forum> ( <td widt° 56' N, 11° 35' O</span><br /></td>) Linux -> Bash : http://tinyurl.com/2ukkge
[11:19:01 AM] <Forum> ( <td widt° 56' N, 11° 35' O</span><br /></td>) Linux -> Bash : http://tinyurl.com/2ukkge

Your post breaks forumbot
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

Thanks for the reply's :-)

I'm trying to set up an effective and automated site development environment at newspring.clan-sy.com.
The idea is to have a script to replace the site with a svn revision of choice.
So the script would do a checkout of the www-root dir in svn and move it to the site dev. env. remove the .svn stuff update the database and copy extra data like the forum avatars and wiki pictures to it.
User avatar
det
Moderator
Posts: 737
Joined: 26 Nov 2005, 11:22

Post by det »

Then what Auswaschbar suggested is correct. Just use "svn export" to check out from the repo without the ".svn" dirs.
User avatar
Tim Blokdijk
Posts: 1242
Joined: 29 May 2005, 11:18

Post by Tim Blokdijk »

I think so to but it's nice to have an alternative to.
Post Reply

Return to “Linux”