Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for momc command where data model or folder path contain spaces #1231

Merged
merged 1 commit into from

4 participants

@dhennessy

Fix the momc commands in copy_resources_script so that spaces in the data model file or in UNLOCALIZED_RESOURCES_FOLDER_PATH are handled correctly.

@coveralls

Coverage Status

Coverage remained the same when pulling ff8417f on dhennessy:dh-fix-momc-spaces into 8d16e1b on CocoaPods:master.

@gfontenot

:thumbsup: Looks good to me. Thanks, guys.

@fabiopelosin fabiopelosin merged commit ff8417f into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/cocoapods/generator/copy_resources_script.rb
View
10 lib/cocoapods/generator/copy_resources_script.rb
@@ -101,9 +101,13 @@ def script
echo "cp -fpR ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
cp -fpR "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
- *.xcdatamodel | *.xcdatamodeld)
- echo "xcrun momc \\"${PODS_ROOT}/$1\\" \\"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/$1.momd\\""
- xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/$1.momd"
+ *.xcdatamodel)
+ echo "xcrun momc \\"${PODS_ROOT}/$1\\" \\"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\\""
+ xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
+ ;;
+ *.xcdatamodeld)
+ echo "xcrun momc \\"${PODS_ROOT}/$1\\" \\"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\\""
+ xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
;;
*)
echo "${PODS_ROOT}/$1"
Something went wrong with that request. Please try again.