Created
March 9, 2016 19:18
-
-
Save cjwinchester/8d3646f0d4c727f1d133 to your computer and use it in GitHub Desktop.
Read a local markdown file and post as a new gist.
This file contains hidden or 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
# like ok say you have a local file called `test.md` and your access token saved as an environmental variable ($GITHUB_TOKEN) | |
file_contents=$(cat test.md); curl -u cjwinchester:$GITHUB_TOKEN -X POST -d '{ "files": { "test.md": { "content": "'"$(echo $file_contents)"'" } }, "description": "testing the gist endpoint here don't mind me", "public": true }' https://api.github.com/gists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment