Commit d877a56dd9ad293683a28ff3be347994ea1bcf3a
1 parent
9e7ac9ee
Exists in
master
and in
20 other branches
Noosfero::VERSION: fix detecting git version for good
Showing
1 changed file
with
7 additions
and
1 deletions
Show diff stats
lib/noosfero/version.rb
... | ... | @@ -6,7 +6,13 @@ end |
6 | 6 | root = File.expand_path(File.dirname(__FILE__) + '/../..') |
7 | 7 | if File.exist?(File.join(root, '.git')) && system('which git >/dev/null') |
8 | 8 | git_version = Dir.chdir(root) { `git describe --tags`.to_s.strip.sub('-rc', '~rc') } |
9 | - if git_version > Noosfero::VERSION | |
9 | + version_sort = IO.popen(['sort', '--version-sort'], 'w+') | |
10 | + version_sort.puts(Noosfero::VERSION) | |
11 | + version_sort.puts(git_version) | |
12 | + version_sort.close_write | |
13 | + new_version = version_sort.readlines.last.strip | |
14 | + if new_version != Noosfero::VERSION | |
10 | 15 | Noosfero::VERSION.clear << git_version |
11 | 16 | end |
17 | + version_sort.close | |
12 | 18 | end | ... | ... |