Created
January 1, 2020 15:06
-
-
Save pleasemarkdarkly/a14dea7b48624d75508ec775eebf09e9 to your computer and use it in GitHub Desktop.
My gist poster didnt want to add a description, boo hoo. The script posting robot has added this message. For your pleasure.
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/bash | |
desc='My gist poster didnt want to add a description, boo hoo. The script posting robot has added this message. For your pleasure.' | |
function post_private_gist () { | |
[[ -z "$1" ]] && {echo "Usage: post_private_gist [filename] [description]" } | |
[[ -z "$2" ]] && {echo "No description, must be really awesome code."} | echo "Missing filename and description" | |
desc=$2 | |
pbcopy < $1 | |
gist -f $1 \ | |
-d $desc \ | |
-s -P | |
} | |
function post_public_gist () { | |
[[ -z "$1" ]] && {echo "Usage: post_private_gist [filename] [description]."} | |
[[ -z "$2" ]] && {echo "No description? Gist viewers will be disappointed."; echo "Will add default message"} | echo "Missing filename and decription" | |
pbcopy < $1 | |
gist -f $1 \ | |
-d $desc \ | |
-P | |
} | |
function login_gist () { | |
gist --login | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment