mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-12-18 16:27:17 +00:00
25 lines
361 B
Plaintext
25 lines
361 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
#
|
||
|
# mfadd
|
||
|
#
|
||
|
# Add a remote and fetch it
|
||
|
#
|
||
|
|
||
|
MFINFO=$(mfinfo) || exit
|
||
|
|
||
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
||
|
|
||
|
REPO=${INFO[2]}
|
||
|
OLDBRANCH=${INFO[4]}
|
||
|
|
||
|
case "$#" in
|
||
|
1 ) USER=$1 ;;
|
||
|
* ) echo "Usage: `basename $0` [user]" 1>&2 ; exit 1 ;;
|
||
|
esac
|
||
|
|
||
|
set -e
|
||
|
|
||
|
echo "Adding and fetching $USER..."
|
||
|
|
||
|
git remote add -f "$USER" "git@github.com:$USER/$REPO.git"
|