Sha256: 741b7094d06e7370b24d702747fb78bce0e553c3605d31310a8f2ed3b3c5cfb0

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

# A fix in embeded frameworks script.
#
# The framework file in pod target folder is a symblink. The EmbedFrameworksScript use `readlink`
# to read the read path. As the symlink is a relative symlink, readlink cannot handle it well. So
# we override the `readlink` to a fixed version.
#
module Pod
  module Generator
    class EmbedFrameworksScript
      old_method = instance_method(:script)
      define_method(:script) do
        script = old_method.bind(self).call
        patch = <<-SH.strip_heredoc
          #!/bin/sh
          # ---- this is added by cocoapods-binary ---
          # Readlink cannot handle relative symlink well, so we override it to a new one
          # If the path isn't an absolute path, we add a realtive prefix.
          old_read_link=`which readlink`
          readlink () {
            path=`$old_read_link "$1" "$2"`;
            if [ $(echo "$path" | cut -c 1-1) = '/' ]; then
              echo $path;
            else
              echo "`dirname $1`/$path";
            fi
          }
          # ---
        SH

        # patch the rsync for copy dSYM symlink
        script = script.gsub "rsync --delete", "rsync --copy-links --delete"
        patch + script
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cocoapods-binary-cache-next-0.1.16 lib/cocoapods-binary-cache/pod-binary/integration/patch/embed_framework_script.rb
cocoapods-binary-cache-next-0.1.15 lib/cocoapods-binary-cache/pod-binary/integration/patch/embed_framework_script.rb