Sha256: 245facaf4479a57030eccc9dca418f4234ea2dc638393519958200f4be52c7fb

Contents?: true

Size: 1.72 KB

Versions: 2

Compression:

Stored size: 1.72 KB

Contents

module Fastlane
  module Actions
    class GitAddAction < Action
      def self.run(params)
        if params[:path].kind_of?(String)
          paths = params[:path].shellescape
        else
          paths = params[:path].map(&:shellescape).join(' ')
        end

        result = Actions.sh("git add #{paths}")
        UI.success("Successfully added \"#{params[:path]}\" 💾.")
        return result
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Directly add the given file"
      end

      def self.details
        ""
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :path,
                                       description: "The file you want to add",
                                       is_string: false,
                                       verify_block: proc do |value|
                                         if value.kind_of?(String)
                                           raise "Couldn't find file at path '#{value}'".red unless File.exist?(value)
                                         else
                                           value.each do |x|
                                             raise "Couldn't find file at path '#{x}'".red unless File.exist?(x)
                                           end
                                         end
                                       end)
        ]
      end

      def self.output
      end

      def self.return_value
        nil
      end

      def self.authors
        ["4brunu"]
      end

      def self.is_supported?(platform)
        true
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fastlane-1.68.0 lib/fastlane/actions/git_add.rb
fastlane-1.67.0 lib/fastlane/actions/git_add.rb