diff --git a/build/envsetup.sh b/build/envsetup.sh index 3984c4ac..86315a95 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -322,6 +322,22 @@ function githubremote() echo "Remote 'github' created" } +function privateremote() +{ + 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 private 2> /dev/null + local REMOTE=$(git config --get remote.github.projectname) + + local PROJECT=$(echo $REMOTE | sed -e "s#https://github.com/##g") + + git remote add private git@github.com:$PROJECT.git + echo "Remote 'private' created" +} + function installboot() { if [ ! -e "$OUT/recovery/root/system/etc/recovery.fstab" ]; diff --git a/build/soong/bin/hmm b/build/soong/bin/hmm index 19083bab..48967589 100644 --- a/build/soong/bin/hmm +++ b/build/soong/bin/hmm @@ -15,6 +15,7 @@ Additional LineageOS functions: - aospremote: Add git remote for matching AOSP repository. - cloremote: Add git remote for matching CodeLinaro repository. - githubremote: Add git remote for LineageOS Github. +- privateremote: Add git remote for Github with ssh access. - mka: Alias to "m". - mkap: Builds the module(s) using mka and pushes them to the device. - cmka: Cleans and builds using mka.