install.fairie/home/dot_local/bin/executable_upload-gist.tmpl
Brian Zalewski 2731e1121b Latest
2024-05-28 03:45:14 +00:00

16 lines
337 B
Bash

#!/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