Added option to specify base

This commit is contained in:
meza 2014-09-11 13:10:01 +01:00
parent 526c4f6664
commit be5362b025

View file

@ -10,7 +10,7 @@ abort() {
}
#
# Produce json with <title>, <body>, and <head>
# Produce json with <title>, <body>, <head> and <base>
#
json() {
@ -19,7 +19,7 @@ json() {
"title": "$1",
"body": "$2",
"head": "$3",
"base": "master"
"base": "$4"
}
EOF
}
@ -48,10 +48,17 @@ echo " create pull-request for $project '$branch'"
echo
printf " title: " && read title
printf " body: " && read body
printf " base [master]: " && read base
echo
# create pull request
body=$(json "$title" "$body" $branch)
if [ -z "$base" ]
then
base="master"
fi
body=$(json "$title" "$body" $branch "$base")
curl -u "$user" "https://api.github.com/repos/$project/pulls" -d "$body"