Marlin-Ai3M/buildroot/share/git/mfadd

21 lines
339 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
#
# mfadd
#
2019-01-31 05:25:28 -06:00
# Add a remote and fetch it
#
2019-01-31 05:25:28 -06:00
[[ $# == 1 ]] || { echo "Usage: `basename $0` user" 1>&2 ; exit 1; }
2019-01-31 05:25:28 -06:00
USER=$1
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"
git fetch "$USER"