#!/bin/sh

#  createZipArchive.sh
#  Capo
#
#  Created by Christopher Liscio on 11-07-05.
#  Copyright 2011 SuperMegaUltraGroovy. All rights reserved.

RESULTS_DIR=~/BuildOutput
APP_BUNDLE_PATH=${ARCHIVE_PRODUCTS_PATH}${INSTALL_PATH}/${WRAPPER_NAME}
ARCHIVE_NAME=${PRODUCT_NAME}-${CURRENT_MARKETING_VERSION}.zip

mkdir -p ${RESULTS_DIR}
pushd ${RESULTS_DIR}

# Create a zip file, using the same method as the Finder
ditto -c -k --sequesterRsrc --keepParent "${APP_BUNDLE_PATH}" "${ARCHIVE_NAME}"
if [ ${?} -ne 0 ]
then
    exit ${?}
fi

popd