-
-
Save syranez/2601228 to your computer and use it in GitHub Desktop.
Create a new GitHub repo and check the response.
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
#! /usr/bin/env bash | |
user="syranez" | |
directory="/dev/shm/json" | |
root_node="git" | |
read -s -p "GitHub password: " pass | |
response=$(curl -s -u "${user}:$pass" https://api.github.com/user/repos -d "{\"name\":\"$1\"}") | |
# from https://github.com/syranez/shell-json | |
php ./shelljson.php --root="${root_node}" --directory="${directory}" "${response}"; | |
if [ ! $? -eq 0 ]; then | |
echo "error: $?"; | |
exit $?; | |
fi | |
echo $(cat "${directory}/${root_node}/message"); | |
git remote add origin git@github.com:${user}/$1.git | |
rm -r "${directory}/${root_node}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment