Class: Fastlane::Actions::RestoreFileAction
Constant Summary
Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES
Class Method Summary
collapse
action_name, authors, deprecated_notes, details, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text
Class Method Details
.author ⇒ Object
21
22
23
|
# File 'fastlane/lib/fastlane/actions/restore_file.rb', line 21
def self.author
"gin0606"
end
|
.available_options ⇒ Object
25
26
27
28
29
30
31
|
# File 'fastlane/lib/fastlane/actions/restore_file.rb', line 25
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :path,
description: "Original file name you want to restore",
optional: false)
]
end
|
.category ⇒ Object
39
40
41
|
# File 'fastlane/lib/fastlane/actions/restore_file.rb', line 39
def self.category
:misc
end
|
.description ⇒ Object
13
14
15
|
# File 'fastlane/lib/fastlane/actions/restore_file.rb', line 13
def self.description
'This action restore your file that was backed up with the `backup_file` action'
end
|
.example_code ⇒ Object
33
34
35
36
37
|
# File 'fastlane/lib/fastlane/actions/restore_file.rb', line 33
def self.example_code
[
'restore_file(path: "/path/to/file")'
]
end
|
.is_supported?(platform) ⇒ Boolean
17
18
19
|
# File 'fastlane/lib/fastlane/actions/restore_file.rb', line 17
def self.is_supported?(platform)
true
end
|
.run(params) ⇒ Object
4
5
6
7
8
9
10
11
|
# File 'fastlane/lib/fastlane/actions/restore_file.rb', line 4
def self.run(params)
path = params[:path]
backup_path = "#{path}.back"
UI.user_error!("Could not find file '#{backup_path}'") unless File.exist?(backup_path)
FileUtils.cp(backup_path, path, preserve: true)
FileUtils.rm(backup_path)
UI.message("Successfully restored backup 📤")
end
|