Tuesday, April 17, 2012

SVN command line and @2x images

You can't escape it, adding and removing @2x images from the command line don't work. Thanks to a post by behaving on StackOverflow for the solution:


You need to add a "@" sign in the end to get SVN to process the file.
For example, if you had a file called foo@2x.png which you want to add to SVN, you would type:
svn add foo@2x.png@
If you have lots of files with the "@" symbol in their name that you want to process in a batch (i.e. use * wildcard), you can do something like this in OS X Terminal:
find . -name "*@*" | xargs -I % svn add %@
The above command will use the find utility to list out each file with @ in its filename and then pipe the path to the file to SVN using XARGS. XARGS will replace each occurrence of % with the path and append the special "@" at the end of the filename so that SVN will accept it.

No comments:

Post a Comment