repoctl: divers bugs
This commit is contained in:
parent
4fdd23c8eb
commit
747c563a2b
14
repoctl
14
repoctl
|
@ -147,11 +147,11 @@ function gogs_create_action() {
|
|||
local url repourl desc payload result
|
||||
local -a vars
|
||||
if [ -n "$user" -a "$user" != "$gogs_user" ]; then
|
||||
# lister les dépôts d'une organisation
|
||||
url="$gogs_url/api/v1/orgs/$user/repos"
|
||||
# créer un dépôt dans une organisation
|
||||
url="$gogs_url/api/v1/org/$user/repos"
|
||||
repourl="$gogs_url/$user/$path"
|
||||
else
|
||||
# lister les dépôts accessibles par l'utilisateur
|
||||
# créer un dépôt pour un utilisateur
|
||||
url="$gogs_url/api/v1/user/repos"
|
||||
repourl="$gogs_url/$gogs_user/$path"
|
||||
fi
|
||||
|
@ -221,11 +221,10 @@ function gogs_get_action() {
|
|||
local -a vars
|
||||
url="$gogs_url/api/v1/repos/$user/$path"
|
||||
repourl="$gogs_url/$user/$path"
|
||||
setx payload=json_build owner="$user" repo="$path"
|
||||
|
||||
[ $# -gt 0 ] && vars=("$@") || vars=("")
|
||||
local HTTP_METHOD=GET
|
||||
setx result=curlto "$url" "$payload" "" \
|
||||
setx result=curlto "$url" "" "" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H "Authorization: token $gogs_key" || \
|
||||
die "Une erreur s'est produite lors de la tentative de déplacement du dépôt
|
||||
|
@ -253,7 +252,7 @@ function gogs_edit_action() {
|
|||
local -a vars
|
||||
url="$gogs_url/api/v1/repos/$user/$path"
|
||||
repourl="$gogs_url/$user/$path"
|
||||
vars=(owner="$user" repo="$path")
|
||||
vars=()
|
||||
while [[ "$1" == *=* ]]; do
|
||||
vars+=("$1")
|
||||
shift
|
||||
|
@ -289,10 +288,9 @@ function gogs_delete_action() {
|
|||
local url repourl payload result
|
||||
url="$gogs_url/api/v1/repos/$user/$path"
|
||||
repourl="$gogs_url/$user/$path"
|
||||
setx payload=json_build owner="$user" repo="$path"
|
||||
|
||||
local HTTP_METHOD=DELETE
|
||||
setx result=curlto "$url" "$payload" "" \
|
||||
setx result=curlto "$url" "" "" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H "Authorization: token $gogs_key" || \
|
||||
die "Une erreur s'est produite lors de la tentative de suppression du dépôt
|
||||
|
|
Loading…
Reference in New Issue