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.68.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.67.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.66.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.65.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.64.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.63.1 lib/fastlane/actions/number_of_commits.rb
fastlane-1.63.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.62.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.61.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.60.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.59.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.58.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.57.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.56.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.55.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.54.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.53.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.52.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.51.0 lib/fastlane/actions/number_of_commits.rb
fastlane-1.50.0 lib/fastlane/actions/number_of_commits.rb