works, [non]interactively
This commit is contained in:
+15
-3
@@ -14,9 +14,21 @@ test -r $configFile || {
|
||||
|
||||
source $configFile
|
||||
|
||||
url=${server}/api/v1/
|
||||
url=${server}/api/v1/repos/$user/${repo}///issues
|
||||
|
||||
#curl -H "Authorization: Bearer ${token}" "${url}/repos/tom/Support/issues" -d '{"state": "close"}' -H 'Content-Type: application/json' -X GET
|
||||
curl -H "Authorization: Bearer ${token}" "${url}/repos/tom/Support/issues" -X POST -d '{"title": "test"}' -H 'Content-Type: application/json'
|
||||
if [ $# -gt 0 ] ; then
|
||||
customer=$1
|
||||
title=$2
|
||||
text=$3
|
||||
else
|
||||
read -p "customer: " customer
|
||||
read -p "title: " title
|
||||
read -p "text - use \\n for multiline " text
|
||||
fi
|
||||
|
||||
data="{ \"title\": \"$customer $title\",\"state\": \"open\",\"body\": \"$text\"}"
|
||||
echo "$data"
|
||||
|
||||
curl -H "Authorization: Bearer ${token}" "${url}" -X POST -H 'Content-Type: application/json' -d "$data"
|
||||
|
||||
[ $? -eq 0 ] && { echo issue created ; }
|
||||
Reference in New Issue
Block a user