bootstrap/getter.sh

30 lines
478 B
Bash
Executable File

#!/bin/bash
stow=0
if [ "$1" = "-s" ]
then
stow=1
shift
fi
targets="$@"
for t in $targets
do
if [ -d "$t" ]
then
echo "$t already exists, not getting"
else
echo "Getting $t"
git clone "http://adamgoldsmith.name/cgit/dotfiles/$t.git" --recurse-submodules
cd $t
git remote set-url origin http://adamgoldsmith.name/cgit/dotfiles/$t.git
git remote set-url --push origin ag:/srv/git/dotfiles/$t.git
cd ..
fi
done
if [ "$stow" -eq 1 ]
then
./stower.sh "$@"
fi