diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-03-06 20:47:03 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-03-06 20:47:03 +0100 |
commit | 5ba4ab79d1c890e7367132ed6926ea643ae78025 (patch) | |
tree | 6bbfa7cf592ed1f5dbf87a6e55949be58cb1db97 | |
parent | 4aade2961d42ef00f4247e1fa91e5d0803c9ddb7 (diff) | |
download | bin-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.sh | 16 |
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 |