Skip to content

Commit

Permalink
Merge pull request #108 from rudolfs/master
Browse files Browse the repository at this point in the history
Update plugins only if there is a newer version
  • Loading branch information
alup committed Jan 20, 2015
2 parents 4e801f1 + 9a82716 commit b3ddecb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
timeout => $timeout,
cwd => $destination,
require => Exec["rbenv::plugin::checkout ${user} ${plugin_name}"],
onlyif => 'git remote update; if [ "$(git rev-parse @{0})" = "$(git rev-parse @{u})" ]; then return 0; else return 1; fi ]',
}

}
5 changes: 4 additions & 1 deletion spec/defines/rbenv__plugin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
:user => user,
:cwd => target_path,
:require => /rbenv::plugin::checkout #{user} #{plugin_name}/,
:path => ['/bin','/usr/bin','/usr/sbin']
:path => ['/bin','/usr/bin','/usr/sbin'],
:onlyif => 'git remote update; ' \
'if [ "$(git rev-parse @{0})" = "$(git rev-parse @{u})" ]; ' \
'then return 0; else return 1; fi ]'
)
end

Expand Down

0 comments on commit b3ddecb

Please sign in to comment.