diff --git a/func/git.sh b/func/git.sh index ffb3128..0f14940 100644 --- a/func/git.sh +++ b/func/git.sh @@ -33,9 +33,15 @@ gitinit(){ git commit -m "Initial commit" git branch -M main - 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)")}" + msg_info "Try to create reposiroty on git server : curl -X POST ${CONFIG_GIT_SERVER}/api/v1/user/repos + -H accept: application/json + -H Authorization: token ${CONFIG_GIT_TOKEN_INIT} + -H Content-Type: application/json + -d {\"name\":\"frogg_ssl_check\", \"private\":true}" + # Create repo on git server if ! curl -X POST "${CONFIG_GIT_SERVER}/api/v1/user/repos" \ -H "accept: application/json" \ @@ -49,7 +55,7 @@ gitinit(){ # Push repo on git server if ! git push -u origin main; then - msg_error "Error while pushing to ${3:-$CONFIG_GIT_SERVER}$(basename "$(pwd)")}" + msg_error "Error while pushing to ${3:-$CONFIG_GIT_SERVER}$(basename "$(pwd)"}" return 2 fi }