Permalink
Browse files

Take style guide into account: fix vars and formatting

  • Loading branch information...
1 parent 64241bf commit 82f98e28631df4fda4a158f72f98bc7196937efc @vStone vStone committed Mar 4, 2012
Showing with 15 additions and 8 deletions.
  1. +15 −8 manifests/repo.pp
View
@@ -1,23 +1,30 @@
-define git::repo($target, $bare = false, $source = false, $user = 'root') {
+define git::repo (
+ $target,
+ $bare = false,
+ $source = false,
+ $user = 'root'
+) {
require git::params
if $source {
- $cmd = "${git::params::bin} clone $source $target --recursive"
+ $cmd = "${git::params::bin} clone ${source} ${target} --recursive"
} else {
if $bare {
- $cmd = "${git::params::bin} init --bare $target"
+ $cmd = "${git::params::bin} init --bare ${target}"
} else {
- $cmd = "${git::params::bin} init $target"
+ $cmd = "${git::params::bin} init ${target}"
}
}
+ $creates = $bare ? {
+ true => "${target}/objects",
+ false => $target,
+ }
+
exec { "git_repo_for_${name}":
command => $cmd,
- creates => $bare ? {
- true => "${target}/objects",
- false => $target,
- },
+ creates => $creates,
require => Class['git::install'],
user => $user
}

0 comments on commit 82f98e2

Please sign in to comment.