summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-03-06 20:47:03 +0100
committerFlorian Pritz <bluewind@xinu.at>2013-03-06 20:47:03 +0100
commit5ba4ab79d1c890e7367132ed6926ea643ae78025 (patch)
tree6bbfa7cf592ed1f5dbf87a6e55949be58cb1db97
parent4aade2961d42ef00f4247e1fa91e5d0803c9ddb7 (diff)
downloadbin-5ba4ab79d1c890e7367132ed6926ea643ae78025.tar.gz
bin-5ba4ab79d1c890e7367132ed6926ea643ae78025.tar.xz
init_new_user.sh: only clone if repos don't exist yet
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--init_new_user.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/init_new_user.sh b/init_new_user.sh
index c62601a..51fbec2 100644
--- a/init_new_user.sh
+++ b/init_new_user.sh
@@ -5,11 +5,19 @@ set -e
cd $HOME
mkdir -p git
-git clone git://git.server-speed.net/users/flo/bin
+clone_repo() {
+ repo_url=$1
+ dest_dir=$2
-cd git
-git clone git://git.server-speed.net/users/flo/dotfiles
-cd $HOME
+ if [[ -e $dest_dir ]]; then
+ return 0
+ fi
+
+ git clone "$repo_url" "$dest_dir"
+}
+
+clone_repo git://git.server-speed.net/users/flo/bin bin
+clone_repo git://git.server-speed.net/users/flo/dotfiles git/dotfiles
for i in .zshrc .vimrc .screenrc .screenrc-2 .zprofile .htoprc .dircolors .vim .gitconfig .gitignore .bashrc; do
ln -sf git/dotfiles/$i $i