-
-
Save bonelifer/9819ecdce28ecf32183f3392de5dc4f9 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