Michiel's answer was almost what I was looking for until I found out that the archive does not include parent folder which is highly necessary for WordPress plugin developers once you are trying to archive a plugin.
If WordPress plugin does not include the container folder, then WordPress is unable to install a plugin.
So I spent quite a bit of time trying to learn Shell commands and testing until I came up with a working solution that would include the container folder inside the newly created archive.
And this is the script you can copy and reuse:
name=("$@")
cd "$name"
cd ..
zipFileName=`basename "$name"`
zip "${zipFileName}.zip" -r "$zipFileName" -x "*.git*" -x "*.svn*" -x "*/.DS_Store" -x "*/__MACOSX"
Created an in-depth article about this topic on my blog with additional images and notes here.
zip -r foo.zip foo -x *.DS_Store -x *.svn*– whaley Oct 12 '10 at 14:50lssaysIcon?, but I think it's ASCII0x0Aat the end. If you have an OS X system, copy & paste an icon from one file info dialog to another (select the icon on the top left andCmd-C, then on a folder info dialog the same withCmd-V). Then the file is created within the folder. – Daniel Beck Oct 13 '10 at 10:54zipor something comparable internally, which is why I asked in the first place -- the OP already has made up his mind; I merely wanted to provide additional information for others. Since it's very closely related to the question and your answer, my comments belong here. Thanks for the hint with?; will have to figure out how to unexcludeIcons, but it's a start. – Daniel Beck Oct 13 '10 at 13:56