Sha256: 7d6ea07b988c72f3dd8fdb23d8733946ec00288ce9a3b8415f41c7de08fd074f

Contents?: true

Size: 1.66 KB

Versions: 96

Compression:

Stored size: 1.66 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.available_options
        [
          FastlaneCore::ConfigItem.new(key: :path,
                                       description: "The file you want to commit",
                                       is_string: false),
          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

      def self.example_code
        [
          'git_commit(path: "./version.txt", message: "Version Bump")',
          'git_commit(path: ["./version.txt", "./changelog.txt"], message: "Version Bump")',
          'git_commit(path: ["./*.txt", "./*.md"], message: "Update documentation")'
        ]
      end

      def self.category
        :source_control
      end
    end
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
fastlane-2.115.0.beta.20190118200015 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.115.0.beta.20190117200016 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.114.0 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.114.0.beta.20190116200018 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.114.0.beta.20190115200110 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.114.0.beta.20190114200053 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.114.0.beta.20190113200019 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.114.0.beta.20190112200032 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.114.0.beta.20190111200053 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.114.0.beta.20190110200051 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.114.0.beta.20190109200053 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.114.0.beta.20190108200048 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.113.0 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.113.0.beta.20190107200010 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.113.0.beta.20190106200016 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.113.0.beta.20190105200036 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.113.0.beta.20190104200013 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.113.0.beta.20190103200013 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.113.0.beta.20190102200016 fastlane/lib/fastlane/actions/git_commit.rb
fastlane-2.113.0.beta.20190101200013 fastlane/lib/fastlane/actions/git_commit.rb