- fix git init

This commit is contained in:
Frogg 2026-05-15 16:14:01 +02:00
parent a5e7b0b5b3
commit 87c38d365a
1 changed files with 8 additions and 7 deletions

View File

@ -36,18 +36,19 @@ gitinit(){
msg_info "Adding origin : ${3:-$CONFIG_GIT_SERVER}$(basename "$(pwd)")" msg_info "Adding origin : ${3:-$CONFIG_GIT_SERVER}$(basename "$(pwd)")"
git remote add origin "${3:-$CONFIG_GIT_SERVER}$(basename "$(pwd)")}" git remote add origin "${3:-$CONFIG_GIT_SERVER}$(basename "$(pwd)")}"
msg_info "Try to create reposiroty on git server : curl -X POST ${CONFIG_GIT_SERVER}/api/v1/user/repos msg_info "Try to create repository on git server...
-H accept: application/json curl -X POST \"${CONFIG_GIT_SERVER}/api/v1/user/repos\" \\
-H Authorization: token ${CONFIG_GIT_TOKEN_INIT} -H \"accept: application/json\" \\
-H Content-Type: application/json -H \"Authorization: token ${CONFIG_GIT_TOKEN_INIT}\" \\
-d {\"name\":\"frogg_ssl_check\", \"private\":true}" -H \"Content-Type: application/json\" \\
-d \"{\\\"name\\\":\\\"frogg_ssl_check\\\", \\\"private\\\":true}\""
# Create repo on git server # Create repo on git server
if ! curl -X POST "${CONFIG_GIT_SERVER}/api/v1/user/repos" \ if ! curl -f -s -X POST "${CONFIG_GIT_SERVER}/api/v1/user/repos" \
-H "accept: application/json" \ -H "accept: application/json" \
-H "Authorization: token ${CONFIG_GIT_TOKEN_INIT}" \ -H "Authorization: token ${CONFIG_GIT_TOKEN_INIT}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"name":"frogg_ssl_check", "private":true}';then -d "{\"name\":\"frogg_ssl_check\", \"private\":true}"; then
msg_error "Error while creating new repository on ${CONFIG_GIT_SERVER}" msg_error "Error while creating new repository on ${CONFIG_GIT_SERVER}"
return 1 return 1