Class: Fastlane::Actions::BackupFileAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/backup_file.rb

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, details, output, sh, step_text

Class Method Details

.authorObject



18
19
20
# File 'lib/fastlane/actions/backup_file.rb', line 18

def self.author
  "gin0606"
end

.available_optionsObject



22
23
24
25
26
27
28
# File 'lib/fastlane/actions/backup_file.rb', line 22

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :path,
                                 description: "Path to the file you want to backup",
                                 optional: false),
  ]
end

.descriptionObject



10
11
12
# File 'lib/fastlane/actions/backup_file.rb', line 10

def self.description
  'This action backs up your file to "[path].back"'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/fastlane/actions/backup_file.rb', line 14

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
7
8
# File 'lib/fastlane/actions/backup_file.rb', line 4

def self.run params
  path = params[:path]
  FileUtils.cp(path, "#{path}.back", {preserve: true})
  Helper.log.info "Successfully created a backup 💾"
end