Created
June 1, 2019 06:51
-
-
Save igk1972/54071649d4b6b684835928a8a56eb332 to your computer and use it in GitHub Desktop.
Github repo create
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# [ -z "$1" ] || ACCESS_TOKEN="$1" | |
[ -z "$1" ] || ACCESS_AUTH="$1" | |
[ -z "$2" ] || REPO_NAME="$2" | |
# [ -z "$ACCESS_TOKEN" ] && { echo "Token not set" ; exit 1; } | |
[ -z "$ACCESS_AUTH" ] && { echo "Username[:Password] not set" ; exit 1; } | |
[ -z "$REPO_NAME" ] && { echo "Repo not set" ; exit 1; } | |
# curl -s -L -H "Authorization: token $ACCESS_TOKEN" --data \ | |
curl -s -L -u "$ACCESS_AUTH" --data \ | |
\ | |
"{\"name\":\"$REPO_NAME\",\"private\":true,\"has_issues\":false,\"has_projects\":false,\"has_wiki\":false}" \ | |
\ | |
"https://api.github.com/user/repos" | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment