install.fairie/home/dot_local/bin/executable_upload-gist.tmpl

17 lines
337 B
Cheetah
Raw Normal View History

2024-05-27 20:45:14 -07:00
#!/usr/bin/env bash
set -Eeuo pipefail
trap "rm -f ~/.gist" ERR
### Load GITHUB_GIST_TOKEN using envchain
if command -v envchain > /dev/null; then
export $(envchain default env | grep 'GITHUB_GIST_TOKEN')
echo "$GITHUB_GIST_TOKEN" > ~/.gist
fi
### Pass command to gist
gist $*
### Remove home directory clutter
rm -f ~/.gist