Skip to content

Instantly share code, notes, and snippets.

@jthoms1
Last active June 28, 2022 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jthoms1/3223bacef2906fe7c020d95699ba8c08 to your computer and use it in GitHub Desktop.
Save jthoms1/3223bacef2906fe7c020d95699ba8c08 to your computer and use it in GitHub Desktop.
# Type a script or drag a script file from your workspace to insert # Type a script or drag a script file from your workspace to insert its path.
# SRCROOT
# TARGET_NAME
# BUILT_PRODUCTS_DIR
APP_NAME="shopwebapp"
EMBEDDED_DIR="${BUILT_PRODUCTS_DIR}/${TARGET_NAME}.app/portals"
EMBEDDED_APP="${SRCROOT}/../../web/build"
ZIP_FILE="${APP_NAME}.zip"
mkdir "${EMBEDDED_DIR}"
if [ -d "${EMBEDDED_DIR}/${APP_NAME}" ]
then
cd "${EMBEDDED_DIR}"
rm -r "${APP_NAME}"
fi
mkdir "${EMBEDDED_DIR}/${APP_NAME}"
if [ -d "${EMBEDDED_APP}" ]
then
cd "${EMBEDDED_APP}"
zip -vr "${ZIP_FILE}" * -x "*.DS_Store"
unzip "${ZIP_FILE}" -d "${EMBEDDED_DIR}/${APP_NAME}"
rm "${ZIP_FILE}"
else
echo "App ${APP_NAME} has not been built!"
exit 999
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment