summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh31
1 files changed, 29 insertions, 2 deletions
diff --git a/envsetup.sh b/envsetup.sh
index d20d874..23d4bcf 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1533,8 +1533,12 @@ function cmremote()
GERRIT_REMOTE=$(cat .git/config | grep git://github.com | awk '{ print $NF }' | sed s#git://github.com/##g)
if [ -z "$GERRIT_REMOTE" ]
then
- echo Unable to set up the git remote, are you in the root of the repo?
- return 0
+ GERRIT_REMOTE=$(cat .git/config | grep http://github.com | awk '{ print $NF }' | sed s#http://github.com/##g)
+ if [ -z "$GERRIT_REMOTE" ]
+ then
+ echo Unable to set up the git remote, are you in the root of the repo?
+ return 0
+ fi
fi
CMUSER=`git config --get review.review.cyanogenmod.com.username`
if [ -z "$CMUSER" ]
@@ -1545,6 +1549,29 @@ function cmremote()
fi
echo You can now push to "cmremote".
}
+export -f cmremote
+
+function makerecipe() {
+ if [ -z "$1" ]
+ then
+ echo "No branch name provided."
+ return 1
+ fi
+ cd android
+ sed -i s/'default revision=.*'/'default revision="refs\/heads\/'$1'"'/ default.xml
+ git commit -a -m "$1"
+ cd ..
+
+ repo forall -c '
+
+ if [ "$REPO_REMOTE" == "github" ]
+ then
+ pwd
+ cmremote
+ git push cmremote HEAD:refs/heads/'$1'
+ fi
+ '
+}
function cmgerrit() {
if [ $# -eq 0 ]; then