36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'fastlane/lib/fastlane/actions/get_build_number_repository.rb', line 36
def self.command(use_hg_revision_number)
if is_svn?
UI.message("Detected repo: svn")
return 'svn info | grep Revision | egrep -o "[0-9]+"'
elsif is_git_svn?
UI.message("Detected repo: git-svn")
return 'git svn info | grep Revision | egrep -o "[0-9]+"'
elsif is_git?
UI.message("Detected repo: git")
return 'git rev-parse --short HEAD'
elsif is_hg?
UI.message("Detected repo: hg")
if use_hg_revision_number
return 'hg parent --template {rev}'
else
return 'hg parent --template "{node|short}"'
end
else
UI.user_error!("No repository detected")
end
end
|