message: Updated bash script
diff: @@ -63,29 +63,31 @@ fi
  # get_output_file_path takes one bazel target label as an argument, and prints
  # the path of the first output file of the specified target.
  function get_output_file_path {
  - local STARLARK_FILE="${OUTPUT_TMPDIR}/print_output_file.starlark"
  + local STARLARK_OUTPUT_TMPDIR="$(mktemp -d)"
  +
  + local STARLARK_FILE="${STARLARK_OUTPUT_TMPDIR}/print_output_file.starlark"
  cat > "${STARLARK_FILE}" << EOF
  def format(target):
  return target.files.to_list()[0].path
  EOF
  - bazel cquery --config=ios_fat $1 \
  - --output=starlark --starlark:file="${STARLARK_FILE}" 2> /dev/null
  + local FRAMEWORK_PATH=$(bazel cquery --config=ios_fat $1 \
  + --output=starlark --starlark:file="${STARLARK_FILE}" 2> /dev/null)
  +
  + # Clean up the temporary directory for bazel cquery.
  + rm -rf "${STARLARK_OUTPUT_TMPDIR}"
  +
  + echo ${FRAMEWORK_PATH}
  }
  function build_ios_api_framework {
  local TARGET="//tensorflow_lite_support/ios"
  - FULL_TARGET="${TARGET}:${FRAMEWORK_NAME}_framework"
  + FULL_TARGET="${TARGET}:$1_framework"
  "${BAZEL}" build -c opt --config=ios_fat ${FULL_TARGET}
  - OUTPUT_TMPDIR="$(mktemp -d)"
  -
  # Find the path of the iOS framework generated by the above bazel build command
  - IOS_FRAMEWORK_PATH="$(get_output_file_path "${FULL_TARGET}")"
  -
  - # Clean up the temporary directory for bazel cquery.
  - rm -rf "${OUTPUT_TMPDIR}"
  - echo ${OUTPUT_TMPDIR}
  + local IOS_FRAMEWORK_PATH="$(get_output_file_path "${FULL_TARGET}")"
  + echo ${IOS_FRAMEWORK_PATH}
  }
  function create_framework_archive {
  @@ -100,7 +102,7 @@ function create_framework_archive {
  cp "LICENSE" ${TFLS_TMPDIR}
  # Unzip the iOS framework zip generated by bazel to TFLS_TMPDIR
  - unzip ${IOS_FRAMEWORK_PATH} -d "${TFLS_TMPDIR}"/Frameworks
  + unzip $1 -d "${TFLS_TMPDIR}"/Frameworks
  #----- (3) Move the framework to the destination -----
  if [[ "${ARCHIVE_FRAMEWORK}" == true ]]; then
  @@ -135,5 +137,5 @@ function create_framework_archive {
  }
  cd "${TFLS_ROOT_DIR}"
  -build_ios_api_framework
  -create_framework_archive
  \ No newline at end of file
  +ZIPPED_FRAMEWORK_PATH=$(build_ios_api_framework ${FRAMEWORK_NAME})
  +create_framework_archive ${ZIPPED_FRAMEWORK_PATH}
  \ No newline at end of file
  