|
Automator Workflow to Delete All Hidden .svn Folders For OS X 10.5
Article Word Count: 361 [View Summary] Comments (0) |
|
Anyone who has ever used Subversion knows that it can be a chore to clean up a folder that you wish to remove from source control. For example, you want to transfer a web site over to the web server, but don't want all the hidden .svn folders to be copied as well. On the Macintosh, it's even more of a pain because Apple's attempt to make the computer easier to use, has rendered it near impossible to manage hidden files
I searched the web for an answer, and found several Automator workflows that claimed to delete all the hidden .svn folders from a given path, but none worked in OS X 10.5. Something changed. All the "rm" operations to delete files and folders returned "Operation denied" type error messages. It turns out that it was the fact that the files are locked, and the "rm" command cannot delete locked files. Simple enough. So I wrote the Automator workflow which can be installed as a Finder plugin, allowing you to right-click a folder and execute the workflow in one step. Perfect! Now, it's easy to find and remove all those hidden .svn folders. You can create one of your own using the tips below:
- Create a workflow.
- Add the finder item "Get Selected Items"
- Add a "Run Shell Script" item.
- In the Shell Script item, choose to pass input "as arguments", choose a Shell of "/bin/bash", and use the script below as the command text:
for f in "$@"do
find "$f" -name .svn -print0 | xargs -0 chflags -R nouchg
find "$f" -name .svn -print0 | xargs -0 rm -fr
done
You could get fancy, and add "Ask for Confirmation" to the very top of the workflow, so be prompted before executing the command. Either way, it works great. Your last step would be to "Save" the workflow as a Finder plugin, by choosing "File > Save as Plug-In". Now, log off and then back on, and right click a folder. From the contextual menu, simply choose "More" and you should see Automator actions as a menu option. Your plugin is in there.
I hope I've saved you a few pain relievers.
|
ABOUT MEZZOCODE, LLC Mezzocode, formerly pocketkaos, is an information technology consulting, design and development company that helps its clients use the web to grow their businesses. What does that mean? Well, that's different for each company. Some companies want to use the internet to attract and acquire new customers, or to streamline their internal processes. Others want to find a better way to communicate or build brand awareness. No matter what your goals are, Mezzocode can help you accomplish them by learning your business and needs, designing the technical architecture, and developing the final product. And we can do this entirely on our own, or seamlessly assist your existing development team. Article Source: http://EzineArticles.com/?expert=Michael_Argentini |
|
This article has been viewed 680 time(s).
Article Submitted On: May 04, 2008
-
MLA Style Citation:
Argentini, Michael "Automator Workflow to Delete All Hidden .svn Folders For OS X 10.5." Automator Workflow to Delete All Hidden .svn Folders For OS X 10.5. 4 May. 2008 EzineArticles.com. 22 Nov. 2009 <http://ezinearticles.com/?Automator-Workflow-to-Delete-All-Hidden-.svn-Folders-For-OS-X-10.5&id=1153212>.
-
APA Style Citation:
Argentini, M. (2008, May 4). Automator Workflow to Delete All Hidden .svn Folders For OS X 10.5. Retrieved November 22, 2009, from http://ezinearticles.com/?Automator-Workflow-to-Delete-All-Hidden-.svn-Folders-For-OS-X-10.5&id=1153212
-
Chicago Style Citation:
Argentini, Michael "Automator Workflow to Delete All Hidden .svn Folders For OS X 10.5." Automator Workflow to Delete All Hidden .svn Folders For OS X 10.5 EzineArticles.com. http://ezinearticles.com/?Automator-Workflow-to-Delete-All-Hidden-.svn-Folders-For-OS-X-10.5&id=1153212