Sha256: 398ba29cd183371f2732ea0fdf4a819d2fd7a464dea425951b3a2ca0dcc723e2

Contents?: true

Size: 1.2 KB

Versions: 730

Compression:

Stored size: 1.2 KB

Contents

module Fastlane
  module Actions
    class ClipboardAction < Action
      def self.run(params)
        UI.message("Storing '#{params[:value]}' in the clipboard 🎨")

        `echo "#{params[:value]}" | tr -d '\n' | pbcopy` # we don't use `sh`, as the command looks ugly
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Copies a given string into the clipboard. Works only on macOS"
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :value,
                                       env_name: "FL_CLIPBOARD_VALUE",
                                       description: "The string that should be copied into the clipboard")
        ]
      end

      def self.authors
        ["KrauseFx"]
      end

      def self.is_supported?(platform)
        true
      end

      def self.example_code
        [
          'clipboard(value: "https://docs.fastlane.tools/")',
          'clipboard(value: lane_context[SharedValues::HOCKEY_DOWNLOAD_LINK] || "")'
        ]
      end

      def self.category
        :misc
      end
    end
  end
end

Version data entries

730 entries across 730 versions & 1 rubygems

Version Path
fastlane-2.118.0.beta.20190315200105 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190314200016 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190313200029 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190312200018 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190311200036 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190310200100 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190309200014 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190308200057 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190307200117 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190306200052 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190305200056 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190304200015 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190303200015 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190302200102 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.118.0.beta.20190301200031 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.117.1 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.117.0 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.117.0.beta.20190228200006 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.117.0.beta.20190227200038 fastlane/lib/fastlane/actions/clipboard.rb
fastlane-2.117.0.beta.20190226200042 fastlane/lib/fastlane/actions/clipboard.rb