mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-15 17:56:17 -04:00
Remove util functions from main file
This commit is contained in:
parent
b6cdd29b27
commit
279affba62
19
git-open
19
git-open
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue