Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

copy-www-build-step.sh 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh
  2. #
  3. # Licensed to the Apache Software Foundation (ASF) under one
  4. # or more contributor license agreements. See the NOTICE file
  5. # distributed with this work for additional information
  6. # regarding copyright ownership. The ASF licenses this file
  7. # to you under the Apache License, Version 2.0 (the
  8. # "License"); you may not use this file except in compliance
  9. # with the License. You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing,
  14. # software distributed under the License is distributed on an
  15. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. # KIND, either express or implied. See the License for the
  17. # specific language governing permissions and limitations
  18. # under the License.
  19. #
  20. #
  21. # This script copies the www directory into the Xcode project.
  22. #
  23. # This script should not be called directly.
  24. # It is called as a build step from Xcode.
  25. SRC_DIR="www"
  26. DST_DIR="$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME"
  27. DST_DIR_WWW="$DST_DIR/www"
  28. COPY_HIDDEN=
  29. ORIG_IFS=$IFS
  30. IFS=$(echo -en "\n\b")
  31. if [[ -z "$BUILT_PRODUCTS_DIR" ]]; then
  32. echo "The script is meant to be run as an Xcode build step and relies on env variables set by Xcode."
  33. exit 1
  34. fi
  35. if [[ ! -e "$SRC_DIR" ]]; then
  36. echo "error: Path does not exist: $SRC_DIR"
  37. exit 2
  38. fi
  39. rm -rf "$DST_DIR_WWW"
  40. # Copy www dir recursively
  41. CODE=
  42. if [[ -n $COPY_HIDDEN ]]; then
  43. rsync -Lra "$SRC_DIR" "$DST_DIR"
  44. CODE=$?
  45. else
  46. rsync -Lra --exclude="- .*" "$SRC_DIR" "$DST_DIR"
  47. CODE=$?
  48. fi
  49. if [ $CODE -ne 0 ]; then
  50. echo "error: Error occurred on copying www. Code $CODE"
  51. exit 3
  52. fi
  53. # Copy the config.xml file.
  54. cp -f "${PROJECT_FILE_PATH%.xcodeproj}/config.xml" "$DST_DIR"
  55. IFS=$ORIG_IFS