Class: Fastlane::Actions::NumberOfCommitsAction
Constant Summary
Fastlane::Action::AVAILABLE_CATEGORIES
Class Method Summary
collapse
action_name, author, available_options, lane_context, method_missing, other_action, output, sample_return_value, sh, step_text
Class Method Details
.authors ⇒ Object
36
37
38
|
# File 'lib/fastlane/actions/number_of_commits.rb', line 36
def self.authors
["onevcat"]
end
|
.category ⇒ Object
51
52
53
|
# File 'lib/fastlane/actions/number_of_commits.rb', line 51
def self.category
:source_control
end
|
.description ⇒ Object
24
25
26
|
# File 'lib/fastlane/actions/number_of_commits.rb', line 24
def self.description
"Return the total number of all commits in current git repo"
end
|
.details ⇒ Object
32
33
34
|
# File 'lib/fastlane/actions/number_of_commits.rb', line 32
def self.details
"You can use this action to get the number of commits of this repo. This is useful if you want to set the build number to the number of commits."
end
|
.example_code ⇒ Object
44
45
46
47
48
49
|
# File 'lib/fastlane/actions/number_of_commits.rb', line 44
def self.example_code
[
'build_number = number_of_commits
increment_build_number(build_number: build_number)'
]
end
|
.is_git? ⇒ Boolean
4
5
6
7
8
9
|
# File 'lib/fastlane/actions/number_of_commits.rb', line 4
def self.is_git?
Actions.sh 'git rev-parse HEAD'
return true
rescue
return false
end
|
.is_supported?(platform) ⇒ Boolean
40
41
42
|
# File 'lib/fastlane/actions/number_of_commits.rb', line 40
def self.is_supported?(platform)
true
end
|
.return_value ⇒ Object
28
29
30
|
# File 'lib/fastlane/actions/number_of_commits.rb', line 28
def self.return_value
"The total number of all commits in current git repo"
end
|
.run(params) ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/fastlane/actions/number_of_commits.rb', line 11
def self.run(params)
if is_git?
command = 'git rev-list HEAD --count'
else
UI.user_error!("Not in a git repository.")
end
return Actions.sh(command).strip.to_i
end
|