pull/333/head
nightwing 2016-07-25 19:28:08 +00:00
rodzic 779fc92460
commit ef51842a6d
1 zmienionych plików z 24 dodań i 3 usunięć

Wyświetl plik

@ -2,13 +2,34 @@
set -e
cd `dirname $0`/..
# set -x
NAME=$1
URL=$2
shift
BRANCH=
URL=
for i in "$@"; do
case $i in
-b=*|--branch=*)
BRANCH="${i#*=}"
shift
;;
-u=*|--url=*)
URL="${i#*=}"
shift
;;
*)
# unknown option
;;
esac
done
if [ "$NAME" == "" ]; then
echo "add name [url]"
echo "add name [--url=git@github.com:c9/NAME.git] [--branch=master]"
exit 0
fi
echo adding name=$NAME url=$URL branch=refs/remotes/origin/$BRANCH
if [ "$URL" == "" ]; then
URL=git@github.com:c9/$NAME.git
fi
@ -28,7 +49,7 @@ else
fi
pushd $NAME
HASH=$(git rev-parse --revs-only refs/remotes/origin/master)
HASH=$(git rev-parse --revs-only refs/remotes/origin/$BRANCH)
popd
[ -f ./config.json ] || echo "{}" > ./config.json