Skip to content

Instantly share code, notes, and snippets.

@pleasemarkdarkly
Created January 1, 2020 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pleasemarkdarkly/a14dea7b48624d75508ec775eebf09e9 to your computer and use it in GitHub Desktop.
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.
#!/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