Sha256: 36ed312565f492d3b28cd47f8db485670e4555d24d9873daa2952ef9d4e45707

Contents?: true

Size: 914 Bytes

Versions: 32

Compression:

Stored size: 914 Bytes

Contents

module Fastlane
  module Actions
    class NumberOfCommitsAction < Action
      def self.is_git?
        Actions.sh 'git rev-parse HEAD'
        return true
      rescue
        return false
      end

      def self.run(params)
        if is_git?
          command = 'git rev-list HEAD --count'
        else
          raise "Not in a git repository."
        end
        return Actions.sh(command).strip.to_i
      end

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

      def self.description
        "Return the total number of all commits in current git repo"
      end

      def self.return_value
        "The total number of all commits in current git repo"
      end

      def self.authors
        ["onevcat"]
      end

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

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
fastlane-1.49.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.48.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.47.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.46.1 lib/fastlane/actions/number_of_commits.rb
fastlane-1.46.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.45.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.44.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.43.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.42.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.41.1 lib/fastlane/actions/number_of_commits.rb
fastlane-1.41.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.40.0 lib/fastlane/actions/number_of_commits.rb