Sha256: d9edce47adf712cdd46260c9bdbd1ffb5240b66bf8db74645952c5bea0bb7fab

Contents?: true

Size: 1.4 KB

Versions: 17

Compression:

Stored size: 1.4 KB

Contents

module Pod
  module DirUtil
    def create_target_directory_path_by_spec spec,force
      target_dir = "#{Dir.pwd}/#{spec.name}-#{spec.version}"

      if File.exist? target_dir
        if @force
          Pathname.new(target_dir).rmtree
        else
          UI.warn "Target directory '#{target_dir}' already exists."
        end
      end
      target_dir
    end

    def create_working_directory_by_spec spec,force
      if spec.is_a? String
        return create_working_directory_by_name spec,force
      end
      target_dir = create_target_directory_path_by_spec spec,force
      # Pathname.new(target_dir).mkdir
      work_dir = Dir.tmpdir + '/frameworks-' + Array.new(8) { rand(36).to_s(36) }.join

      Pathname.new(work_dir).mkdir
      [target_dir, work_dir]
    end

    def create_target_directory_path_by_name name, force
      target_dir = "#{Dir.pwd}/#{name}-muti"

      if File.exist? target_dir
        if @force
          Pathname.new(target_dir).rmtree
        else
          UI.warn "Target directory '#{target_dir}' already exists."
        end
      end
      target_dir
    end

    def create_working_directory_by_name name, force
      target_dir = create_target_directory_path_by_name name,force
      # Pathname.new(target_dir).mkdir
      work_dir = Dir.tmpdir + '/frameworks-' + Array.new(8) { rand(36).to_s(36) }.join

      Pathname.new(work_dir).mkdir
      [target_dir, work_dir]
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
cocoapods-bb-xcframework-0.2.6.4 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-bb-xcframework-0.2.6.3 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-bb-xcframework-0.2.6.2 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-bb-xcframework-0.2.6.1 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-bb-xcframework-0.2.6 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-bb-xcframework-0.2.5 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-bb-xcframework-0.2.4.1 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-framework-tj-0.0.2 lib/cocoapods-framework/util/dir_util.rb
cocoapods-xcframework-0.2.4 lib/cocoapods-framework/util/dir_util.rb
cocoapods-bb-xcframework-0.2.3 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-bb-xcframework-0.2.2 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-bb-xcframework-0.2.1 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-bb-xcframework-0.2.0 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-bb-xcframework-0.1.0 lib/cocoapods-xcframework/util/dir_util.rb
cocoapods-xcframework-0.2.1 lib/cocoapods-framework/util/dir_util.rb
cocoapods-xcframework-0.2.0 lib/cocoapods-framework/util/dir_util.rb
cocoapods-xcframework-0.1.1 lib/cocoapods-framework/util/dir_util.rb