title: How to create a zip file in the same format as the Finder's "Compress" menu item?
body: <p>On Mac OS X, you can create a zip archive from the Finder by selecting some files and selecting "Compress" from the contextual menu or the File menu.  Unfortunately, the resulting file is not identical to the archive created by the <code>zip</code> command (with the default options).</p>
  
  <p>This distinction matters to at least one service operated by Apple, which fails to accept archives created with the <code>zip</code> command.  Having to create archives manually is preventing me from fully automating my release build process.</p>
  
  <p>How can I create a zip archive in the correct format within a shell script?</p>
  
  <p>EDIT: Since writing this question long ago, I've figured out that the key difference between <code>ditto</code> and <code>zip</code> is how they handle symbolic links: because the code signature inside an app bundle contains a symlink, it needs to be preserved as a link and not stored as a regular file. <code>ditto</code> does this by default, but <code>zip</code> does not (option <code>-y</code> is required).</p>