class Fastlane::Actions::BackupFileAction

Public Class Methods

author() click to toggle source
# File fastlane/lib/fastlane/actions/backup_file.rb, line 18
def self.author
  "gin0606"
end
available_options() click to toggle source
# File fastlane/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
category() click to toggle source
# File fastlane/lib/fastlane/actions/backup_file.rb, line 36
def self.category
  :misc
end
description() click to toggle source
# File fastlane/lib/fastlane/actions/backup_file.rb, line 10
def self.description
  'This action backs up your file to "[path].back"'
end
example_code() click to toggle source
# File fastlane/lib/fastlane/actions/backup_file.rb, line 30
def self.example_code
  [
    'backup_file(path: "/path/to/file")'
  ]
end
is_supported?(platform) click to toggle source
# File fastlane/lib/fastlane/actions/backup_file.rb, line 14
def self.is_supported?(platform)
  true
end
run(params) click to toggle source
# File fastlane/lib/fastlane/actions/backup_file.rb, line 4
def self.run(params)
  path = params[:path]
  FileUtils.cp(path, "#{path}.back", preserve: true)
  UI.message("Successfully created a backup 💾")
end