Last active
June 25, 2017 14:59
-
-
Save ypchen/aceeaf43144844f1f4275202259b690c to your computer and use it in GitHub Desktop.
Execute a gist (with the specified gist hash)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ -z "${1}" ]; then | |
| echo "${0}" gist_hash [args... ] | |
| fi | |
| FILE_HASH="${1}" | |
| shift | |
| # default | |
| if [ -z ${CURL+x} ]; then | |
| CURL="/usr/bin/curl" | |
| fi | |
| # gist_user & CURL if necessary | |
| CONF="${HOME}/.execute-gist.conf" | |
| source ${CONF} | |
| URL_GIST="https://gist.githubusercontent.com/${gist_user}/${FILE_HASH}/raw/" | |
| GIST_CONTENT=`${CURL} --insecure --output - "${URL_GIST}"` | |
| eval "${GIST_CONTENT}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment