- fix git init

This commit is contained in:
Frogg 2026-05-15 16:08:20 +02:00
parent 51f6fa3098
commit a5e7b0b5b3
1 changed files with 8 additions and 2 deletions

View File

@ -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
}