Skip to content

Commit

Permalink
Clone silently if dumping a boilerplate
Browse files Browse the repository at this point in the history
If gibo needs to initialise its local repo when run in
"dump mode" (i.e. gibo BOILERPLATE_NAME) then silence
git output so that it doesn't contaminate the script
output.
  • Loading branch information
Simon Whitaker committed May 29, 2012
1 parent ab6ec16 commit 05eca21
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions gibo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ remote_repo=https://github.com/github/gitignore.git
local_repo=$HOME/.gitignore-boilerplates

version() {
echo "$(basename $0) 1.0 by Simon Whitaker <simon@goosoftware.co.uk>"
echo "$(basename $0) 1.0.1 by Simon Whitaker <simon@goosoftware.co.uk>"
echo "https://github.com/simonwhitaker/gitignore-boilerplates"
}

Expand All @@ -36,13 +36,17 @@ EOF
}

clone() {
echo "Cloning $remote_repo to $local_repo"
git clone "$remote_repo" "$local_repo"
if [ $1 -a $1 = '--silently' ]; then
git clone -q "$remote_repo" "$local_repo"
else
echo "Cloning $remote_repo to $local_repo"
git clone "$remote_repo" "$local_repo"
fi
}

init() {
if [ ! -e "$local_repo/.git" ]; then
clone
clone $1
fi
}

Expand Down Expand Up @@ -75,7 +79,7 @@ upgrade() {
}

dump() {
init
init --silently

language_file="$local_repo/$1.gitignore"
global_file="$local_repo/Global/$1.gitignore"
Expand Down

0 comments on commit 05eca21

Please sign in to comment.