bootstrap/getter.sh

30 lines
482 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"
cd $t
git remote set-url origin http://adamgoldsmith.name/cgit/dotfiles/$t.git
git remote set-url --push origin ssh://adamgoldsmith.name:443/srv/git/dotfiles/$t.git
cd ..
fi
done
if [ "$stow" -eq 1 ]
then
./stower.sh "$@"
fi