Last active
December 27, 2015 12:59
-
-
Save inamiy/7329935 to your computer and use it in GitHub Desktop.
Generate CoreData files using mogenerator for each xcdatamodeld.
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
#!/bin/sh | |
modelds=`find . -name '*.xcdatamodeld'` | |
for modeld in $modelds; do | |
# if xccurrentversion exists | |
if [ -a "${modeld}/.xccurrentversion" ]; then | |
currentModel=`/usr/libexec/PlistBuddy "${modeld}/.xccurrentversion" -c 'print _XCCurrentVersionName'` | |
else | |
currentModel=`ls ${modeld} | grep .xcdatamodel | head -1` | |
fi | |
echo "mogenerator -m "${modeld}/${currentModel}" -O "${modeld}/../" --template-var arc=true" | |
mogenerator -m "${modeld}/${currentModel}" -O "${modeld}/../" --template-var arc=true | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment