Sha256: eb1d59998198f4d882d32c81d0b9931e154a59360f199e276cb3d6db1213fea4

Contents?: true

Size: 938 Bytes

Versions: 22

Compression:

Stored size: 938 Bytes

Contents

module Fastlane
  module Actions
    class RestoreFileAction < Action
      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

      def self.description
        'This action restore your file that was backuped with the `backup_file` action'
      end

      def self.is_supported?(platform)
        true
      end

      def self.author
        "gin0606"
      end

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

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
fastlane-1.94.0 lib/fastlane/actions/restore_file.rb
fastlane-1.93.1 lib/fastlane/actions/restore_file.rb
fastlane-1.93.0 lib/fastlane/actions/restore_file.rb
fastlane-1.92.0 lib/fastlane/actions/restore_file.rb
fastlane-1.92.0.beta2 lib/fastlane/actions/restore_file.rb
fastlane-1.92.0.beta1 lib/fastlane/actions/restore_file.rb
fastlane-1.91.0 lib/fastlane/actions/restore_file.rb
fastlane-1.90.0 lib/fastlane/actions/restore_file.rb
fastlane-1.89.0 lib/fastlane/actions/restore_file.rb
fastlane-1.88.0 lib/fastlane/actions/restore_file.rb
fastlane-1.87.1 lib/fastlane/actions/restore_file.rb
fastlane-1.87.0 lib/fastlane/actions/restore_file.rb
fastlane-1.86.1 lib/fastlane/actions/restore_file.rb
fastlane-1.86.0 lib/fastlane/actions/restore_file.rb
fastlane-1.85.0 lib/fastlane/actions/restore_file.rb
fastlane-1.84.0 lib/fastlane/actions/restore_file.rb
fastlane-1.83.0 lib/fastlane/actions/restore_file.rb
fastlane-1.82.0 lib/fastlane/actions/restore_file.rb
fastlane-1.81.0 lib/fastlane/actions/restore_file.rb
fastlane-1.80.0 lib/fastlane/actions/restore_file.rb