Create rubymotion app version from git hash
the most recent git commit: git log -n 1 --pretty=format:'%h'
the last recorded git commit: File.read('version-git.txt') rescue ''
the current patch: File.read('version-patch.txt').to_i rescue 0
if the current git commit and last recorded commit don't match, bump the version-patch number. Then add this to your version (app.version = "X.Y.#{patch}").
or, a simpler way to do this, just tack the git commit hash onto the version number:
app.version = "1.2.3-#{git log -n 1 --pretty=format:'%h'
}"
via @colinta
Written by Clayton McIlrath
Related protips
1 Response
I like this approach:
app.short_version = "1.0.0"
app.version = `git log -n 1 --pretty=format:'%h'`
Which gives short version: 1.0.0
And the hash as the long version
Testflight nicely displays this as 1.0.0(231asdf)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#