Skip to content

Instantly share code, notes, and snippets.

@whiteley
Created February 5, 2018 16:24
Show Gist options
  • Save whiteley/71da518d6eaeb18ece3b687272e60203 to your computer and use it in GitHub Desktop.
Save whiteley/71da518d6eaeb18ece3b687272e60203 to your computer and use it in GitHub Desktop.
#!/bin/bash
LOGFILE=$(mktemp "/tmp/$(basename "${BASH_SOURCE}")_XXXXXXXXXX.log")
exec {BASH_XTRACEFD}>>"${LOGFILE}"
date >> "$LOGFILE"
set -o xtrace
set -o errexit
set -o nounset
CRED_HELPER=$(basename "${BASH_SOURCE%_strip}")
if [ "${1-}" = "get" ]; then
cut -d/ -f3 /dev/stdin | ${CRED_HELPER} get
else
${CRED_HELPER} "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment