Class: Fastlane::Actions::RestoreFileAction
Class Method Summary
collapse
action_name, authors, details, output, sh, step_text
Class Method Details
.author ⇒ Object
21
22
23
|
# File 'lib/fastlane/actions/restore_file.rb', line 21
def self.author
"gin0606"
end
|
.available_options ⇒ Object
25
26
27
28
29
30
31
|
# File '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
|
.description ⇒ Object
13
14
15
|
# File 'lib/fastlane/actions/restore_file.rb', line 13
def self.description
'This action restore your file that was backuped with the `backup_file` action'
end
|
.is_supported?(platform) ⇒ Boolean
17
18
19
|
# File '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 'lib/fastlane/actions/restore_file.rb', line 4
def self.run params
path = params[:path]
backup_path = "#{path}.back"
raise "Could not find file '#{backup_path}'" unless File.exist? backup_path
FileUtils.cp(backup_path, path, {preserve: true})
FileUtils.rm(backup_path)
Helper.log.info "Successfully restored backup 📤"
end
|