Skip to content

Instantly share code, notes, and snippets.

@igk1972
Created June 1, 2019 06:51
Show Gist options
  • Save igk1972/54071649d4b6b684835928a8a56eb332 to your computer and use it in GitHub Desktop.
Save igk1972/54071649d4b6b684835928a8a56eb332 to your computer and use it in GitHub Desktop.
Github repo create
#!/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