Sha256: 7a5ef7ff25b7cdd15dc0811ffee5fb54377f5699db815a26c675f32e37bf5b91

Contents?: true

Size: 932 Bytes

Versions: 69

Compression:

Stored size: 932 Bytes

Contents

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

      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

69 entries across 69 versions & 1 rubygems

Version Path
fastlane-1.47.0 lib/fastlane/actions/restore_file.rb
fastlane-1.46.1 lib/fastlane/actions/restore_file.rb
fastlane-1.46.0 lib/fastlane/actions/restore_file.rb
fastlane-1.45.0 lib/fastlane/actions/restore_file.rb
fastlane-1.44.0 lib/fastlane/actions/restore_file.rb
fastlane-1.43.0 lib/fastlane/actions/restore_file.rb
fastlane-1.42.0 lib/fastlane/actions/restore_file.rb
fastlane-1.41.1 lib/fastlane/actions/restore_file.rb
fastlane-1.41.0 lib/fastlane/actions/restore_file.rb
fastlane-1.40.0 lib/fastlane/actions/restore_file.rb
fastlane-1.39.0 lib/fastlane/actions/restore_file.rb
fastlane-1.38.1 lib/fastlane/actions/restore_file.rb
fastlane-1.38.0 lib/fastlane/actions/restore_file.rb
fastlane-1.37.0 lib/fastlane/actions/restore_file.rb
fastlane-1.36.4 lib/fastlane/actions/restore_file.rb
fastlane-1.36.3 lib/fastlane/actions/restore_file.rb
fastlane-1.36.2 lib/fastlane/actions/restore_file.rb
fastlane-1.36.1 lib/fastlane/actions/restore_file.rb
fastlane-1.36.0 lib/fastlane/actions/restore_file.rb
fastlane-1.35.0 lib/fastlane/actions/restore_file.rb