-
Notifications
You must be signed in to change notification settings - Fork 5.6k
/
clipboard.rb
49 lines (40 loc) 路 1.3 KB
/
clipboard.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
module Fastlane
module Actions
class ClipboardAction < Action
def self.run(params)
value = params[:value]
truncated_value = value[0..800].gsub(/\s\w+\s*$/, '...')
UI.message("Storing '#{truncated_value}' in the clipboard 馃帹")
FastlaneCore::Clipboard.copy(content: value)
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", "joshdholtz", "rogerluan"]
end
def self.is_supported?(platform)
FastlaneCore::Clipboard.is_supported?
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