Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a504aa44 authored by Michael Bestas's avatar Michael Bestas Committed by Sam Mortimer
Browse files

envsetup: Add githubremote function

* Useful for picking changes from our repositories
  to AOSP based repositories before forking them

Change-Id: I4f1d733354591fd3db431dd590ccf46e12f6a342
parent dab1569b
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ Additional LineageOS functions:
- lineageremote:   Add git remote for LineageOS Gerrit Review.
- aospremote:      Add git remote for matching AOSP repository.
- cafremote:       Add git remote for matching CodeAurora repository.
- githubremote:    Add git remote for LineageOS Github.
- mka:             Builds using SCHED_BATCH on all processors.
- mkap:            Builds the module(s) using mka and pushes them to the device.
- cmka:            Cleans and builds using mka.
@@ -343,6 +344,27 @@ function cafremote()
    echo "Remote 'caf' created"
}

function githubremote()
{
    if ! git rev-parse --git-dir &> /dev/null
    then
        echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up."
        return 1
    fi
    git remote rm github 2> /dev/null
    local REMOTE=$(git config --get remote.aosp.projectname)

    if [ -z "$REMOTE" ]
    then
        REMOTE=$(git config --get remote.caf.projectname)
    fi

    local PROJECT=$(echo $REMOTE | sed -e "s#platform/#android/#g; s#/#_#g")

    git remote add github https://github.com/LineageOS/$PROJECT
    echo "Remote 'github' created"
}

function installboot()
{
    if [ ! -e "$OUT/recovery/root/etc/recovery.fstab" ];