class Fastlane::Actions::DeleteFilesAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/delete_files/actions/delete_files_action.rb, line 22
def self.authors
  ["Gary Johnson"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/delete_files/actions/delete_files_action.rb, line 26
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :file_pattern,
                                 description: "Glob file pattern to search for files to delete")
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/delete_files/actions/delete_files_action.rb, line 18
def self.description
  "Deletes a file, folder or multiple files using shell glob pattern."
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/delete_files/actions/delete_files_action.rb, line 33
def self.is_supported?(platform)
  true
end
run(params) click to toggle source
# File lib/fastlane/plugin/delete_files/actions/delete_files_action.rb, line 7
def self.run(params)
  matching_files = Dir.glob(params[:file_pattern])
  unless matching_files.any? 
    UI.message "No files found matching pattern \"#{params[:file_pattern]}\""
    return
  end

  File.delete(*matching_files)
  UI.message "Deleted files: #{matching_files.join(", ")}"
end