Remove util functions from main file

This commit is contained in:
Sean Spearman 2016-10-01 15:47:49 -07:00
parent b6cdd29b27
commit 279affba62

View file

@ -135,25 +135,6 @@ else
fi
giturl=${giturl%\.git}
# Gets url to all PRs for branch
function getAllPrsUrl {
local giturl="$1";
# assumes $giturl is of the form .*/user/repo
local owner=`expr "$giturl" : '.*/\(.*\)/.*$'`
local repo=`expr "$giturl" : '.*/\(.*\)$'`
# github-only solution
local allPrsUrl="https://api.github.com/repos/"$owner"/"$repo"/pulls?head="$owner":"$branch
echo $allPrsUrl;
}
# Gets most recent PR from all PRs for branch
function getPrUrl {
local allPrsUrl="$1"
local unparsedPrUrl=$(curl -s $allPrsUrl | grep -m 1 html_url 2> /dev/null)
local prUrl=`expr "$unparsedPrUrl" : '.*\"\(.*\)\",$'`
echo $prUrl
}
if [ -n "$issue" ]; then
giturl="${giturl}/issues/${issue}"
elif [ -n "$pr" ]; then