diff options
author | drebs <drebs@riseup.net> | 2011-03-12 18:04:39 -0300 |
---|---|---|
committer | drebs <drebs@riseup.net> | 2011-03-12 18:04:39 -0300 |
commit | 6d0cc2a36b1718a737bc88f08d7101eb101ee00b (patch) | |
tree | 5837ae00ae6dbba38454958ab78ca1a76da532ca /templates/bin | |
parent | c250722de28cf556005b0d4103854d13cf781b56 (diff) | |
download | puppet-bootstrap-6d0cc2a36b1718a737bc88f08d7101eb101ee00b.tar.gz puppet-bootstrap-6d0cc2a36b1718a737bc88f08d7101eb101ee00b.tar.bz2 |
refactoring stages
Diffstat (limited to 'templates/bin')
-rw-r--r-- | templates/bin/puppet-bootstrap | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/templates/bin/puppet-bootstrap b/templates/bin/puppet-bootstrap index 6c16f3f..6f93ed4 100644 --- a/templates/bin/puppet-bootstrap +++ b/templates/bin/puppet-bootstrap @@ -1,14 +1,12 @@ #!/bin/sh -puppet_dir=<%= puppet_dir %> - function usage { echo "Usage: $1 add-submodules" exit $2 } function add_submodules { - cd $puppet_dir + cd $1 git init git add . mkdir -p ./modules @@ -22,7 +20,11 @@ function add_submodules { done } -if [[ $# -ne 1 ]]; then +if [ $# -eq 1 ]; then + puppet_dir=$1 +elif [ $# -lt 1 ]; then + puppet_dir=<%= puppet_dir %> +else usage $0 1 exit 1 fi |