Last active
August 29, 2015 14:02
-
-
Save squarefrog/0f867eb494be8028caeb to your computer and use it in GitHub Desktop.
Mogenerator Run Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODEL_DIR="ProjectName/Models" | |
MODEL_NAME="DataModel.xcdatamodeld" | |
PATH_TO_MODELD="${MODEL_DIR}/${MODEL_NAME}" | |
MACHINE_DIR="Machine" | |
HUMAN_DIR="Classes" | |
type mogenerator >/dev/null 2>&1 || { | |
echo >&2 "warning: mogenerator not found. You will need it when changing core data model"; | |
exit 0; | |
} | |
#CURRENT_VERSION=$(/usr/libexec/PlistBuddy -c "Print :_XCCurrentVersionName" "${PATH_TO_MODELD}/.xccurrentversion") | |
CURRENT_VERSION="${MODEL_NAME}" | |
MODEL_PATH="${PATH_TO_MODELD}/${CURRENT_VERSION}" | |
echo "Used model path ${MODEL_PATH}" | |
mogenerator -m $MODEL_PATH --template-var arc=true --machine-dir ${MODEL_DIR}/${MACHINE_DIR} --human-dir ${MODEL_DIR}/${HUMAN_DIR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment