gitea-create-repo/create.sh

18 lines
451 B
Bash
Raw Normal View History

2023-05-22 22:25:18 -07:00
#!/usr/bin/env bash
source .env
REPO_NAME=$(basename $(pwd))
GITEA_USERNAME=aynish
CREATE_REPO=true
curl -X POST -H "Content-Type: application/json" -d "{ \"name\": \"${REPO_NAME}\"}" \
-H "Authorization: token ${GITEA_TOKEN}" \
"https://git.sealight.xyz/api/v1/user/repo"
if [ ${CREATE_REPO} ]; then
git init
git add .
git commit -m "Initial Commit"
git remote add "gitea@git.sealight.xyz:${GITEA_USERNAME}/${REPO_NAME}.git"
git push
fi