Method: AppVersion::Version#suffix

Defined in:
lib/appversion.rb

#suffixObject



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/appversion.rb', line 90

def suffix
  branch = CI.branch || Git.branch
  $stdout.puts "Branch = #{branch}"
  case branch
    when /develop/
      suffix = '-develop'
    when /master/
      suffix = '-master'
    when /feature*/
      suffix = "-#{branch.split('/').last.downcase}"
    when /release*/
      suffix = "-#{branch.split('/').last.downcase}"
    when /hotfix*/
      suffix = "-#{branch.split('/').last.downcase}"
    else
      suffix = '-debug'
  end
  #special case for github releases
  if CI.tagged_build?
    $stdout.puts  'Tagged build, suppressing branch suffix'
    suffix = ''
  end
  return suffix
end