2018-11-16 03:32:01 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# mfadd
|
|
|
|
#
|
2019-01-31 05:25:28 -06:00
|
|
|
# Add a remote and fetch it
|
2018-11-16 03:32:01 -06:00
|
|
|
#
|
|
|
|
|
2019-01-31 05:25:28 -06:00
|
|
|
[[ $# == 1 ]] || { echo "Usage: `basename $0` user" 1>&2 ; exit 1; }
|
2018-11-16 03:32:01 -06:00
|
|
|
|
2019-01-31 05:25:28 -06:00
|
|
|
USER=$1
|
2018-11-16 03:32:01 -06:00
|
|
|
|
|
|
|
MFINFO=$(mfinfo) || exit 1
|
|
|
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
|
|
|
REPO=${INFO[2]}
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
echo "Adding and fetching $USER..."
|
2019-01-31 05:25:28 -06:00
|
|
|
git remote add "$USER" "git@github.com:$USER/$REPO.git"
|
2018-11-16 03:32:01 -06:00
|
|
|
git fetch "$USER"
|