Skip to content

Instantly share code, notes, and snippets.

@popomore
Created February 11, 2014 08:26
Show Gist options
  • Save popomore/8931127 to your computer and use it in GitHub Desktop.
Save popomore/8931127 to your computer and use it in GitHub Desktop.
# install gist by `brew install gist`
#
# create gist on first time
# update gist when .gistid exists
function gist() {
local gistid
args=$@
if [ -f .gistid ]; then
gistid=$(cat .gistid)
fi
if [[ "$args" != *"-u"* ]] && [ "$gistid" != "" ]; then
args=($args -u $gistid)
fi
/usr/local/bin/gist -c $args > .gistid
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment