Sha256: bd4b76366f96cf896639bd7d4364a2fb0e50a4fd70bc61f733b7b29886dc4d35

Contents?: true

Size: 1.71 KB

Versions: 13

Compression:

Stored size: 1.71 KB

Contents

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

        result = Actions.sh("git add #{paths}")
        Helper.log.info "Successfully added \"#{params[:path]}\" 💾.".green
        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

13 entries across 13 versions & 1 rubygems

Version Path
fastlane-1.64.0 lib/fastlane/actions/git_add.rb
fastlane-1.63.1 lib/fastlane/actions/git_add.rb
fastlane-1.63.0 lib/fastlane/actions/git_add.rb
fastlane-1.62.0 lib/fastlane/actions/git_add.rb
fastlane-1.61.0 lib/fastlane/actions/git_add.rb
fastlane-1.60.0 lib/fastlane/actions/git_add.rb
fastlane-1.59.0 lib/fastlane/actions/git_add.rb
fastlane-1.58.0 lib/fastlane/actions/git_add.rb
fastlane-1.57.0 lib/fastlane/actions/git_add.rb
fastlane-1.56.0 lib/fastlane/actions/git_add.rb
fastlane-1.55.0 lib/fastlane/actions/git_add.rb
fastlane-1.54.0 lib/fastlane/actions/git_add.rb
fastlane-1.53.0 lib/fastlane/actions/git_add.rb