Sha256: 352561dde3f37f219d92f09c38c8e3e9cfd0f39396001f4b0d9a16870e3e406e

Contents?: true

Size: 1.96 KB

Versions: 28

Compression:

Stored size: 1.96 KB

Contents

module Fastlane
  module Actions
    class GitCommitAction < 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 commit -m #{params[:message].shellescape} #{paths}")
        UI.success("Successfully committed \"#{params[:path]}\" 💾.")
        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)
                                           UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
                                         else
                                           value.each do |x|
                                             UI.user_error!("Couldn't find file at path '#{x}'") 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

28 entries across 28 versions & 1 rubygems

Version Path
fastlane-1.104.0 lib/fastlane/actions/git_commit.rb
fastlane-1.103.0 lib/fastlane/actions/git_commit.rb
fastlane-1.102.0 lib/fastlane/actions/git_commit.rb
fastlane-1.101.0 lib/fastlane/actions/git_commit.rb
fastlane-1.100.0 lib/fastlane/actions/git_commit.rb
fastlane-1.99.0 lib/fastlane/actions/git_commit.rb
fastlane-1.98.0 lib/fastlane/actions/git_commit.rb
fastlane-1.97.2 lib/fastlane/actions/git_commit.rb
fastlane-1.97.1 lib/fastlane/actions/git_commit.rb
fastlane-1.97.0 lib/fastlane/actions/git_commit.rb
fastlane-1.96.0 lib/fastlane/actions/git_commit.rb
fastlane-1.95.0 lib/fastlane/actions/git_commit.rb
fastlane-1.94.1 lib/fastlane/actions/git_commit.rb
fastlane-1.94.0 lib/fastlane/actions/git_commit.rb
fastlane-1.93.1 lib/fastlane/actions/git_commit.rb
fastlane-1.93.0 lib/fastlane/actions/git_commit.rb
fastlane-1.92.0 lib/fastlane/actions/git_commit.rb
fastlane-1.92.0.beta2 lib/fastlane/actions/git_commit.rb
fastlane-1.92.0.beta1 lib/fastlane/actions/git_commit.rb
fastlane-1.91.0 lib/fastlane/actions/git_commit.rb