Sha256: 82159264e6e5d834619f8decf271cd9457d13c918a71331ef4052f48253c1c0f

Contents?: true

Size: 1.92 KB

Versions: 43

Compression:

Stored size: 1.92 KB

Contents

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

        result = Actions.sh("git commit -m '#{params[:message]}' #{paths}")
        Helper.log.info "Successfully committed \"#{params[:path]}\" 💾.".green
        return result
      end

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

      def self.description
        "Directly commit the given file with the given message"
      end

      def self.details
        ""
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :path,
                                       description: "The file you want to commit",
                                       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),
          FastlaneCore::ConfigItem.new(key: :message,
                                       description: "The commit message that should be used")
        ]
      end

      def self.output
      end

      def self.return_value
        nil
      end

      def self.authors
        ["KrauseFx"]
      end

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

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
fastlane-1.57.0 lib/fastlane/actions/git_commit.rb
fastlane-1.56.0 lib/fastlane/actions/git_commit.rb
fastlane-1.55.0 lib/fastlane/actions/git_commit.rb
fastlane-1.54.0 lib/fastlane/actions/git_commit.rb
fastlane-1.53.0 lib/fastlane/actions/git_commit.rb
fastlane-1.52.0 lib/fastlane/actions/git_commit.rb
fastlane-1.51.0 lib/fastlane/actions/git_commit.rb
fastlane-1.50.0 lib/fastlane/actions/git_commit.rb
fastlane-1.49.0 lib/fastlane/actions/git_commit.rb
fastlane-1.48.0 lib/fastlane/actions/git_commit.rb
fastlane-1.47.0 lib/fastlane/actions/git_commit.rb
fastlane-1.46.1 lib/fastlane/actions/git_commit.rb
fastlane-1.46.0 lib/fastlane/actions/git_commit.rb
fastlane-1.45.0 lib/fastlane/actions/git_commit.rb
fastlane-1.44.0 lib/fastlane/actions/git_commit.rb
fastlane-1.43.0 lib/fastlane/actions/git_commit.rb
fastlane-1.42.0 lib/fastlane/actions/git_commit.rb
fastlane-1.41.1 lib/fastlane/actions/git_commit.rb
fastlane-1.41.0 lib/fastlane/actions/git_commit.rb
fastlane-1.40.0 lib/fastlane/actions/git_commit.rb