Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env bash
# Add to your ~/.zshrc or ~/.profile
# source: https://gist.github.com/mob-sakai/174a32b95572e7d8fdbf8e6f43a528f6
gist() {
GIST_URL=$1
if [[ ! $GIST_URL ]]; then
echo -e "\nGIST_URL is required\n"
else
shift
read "REPLY?Are you trust this script?" # zsh https://superuser.com/questions/555874/zsh-read-command-fails-within-bash-function-read1-p-no-coprocess
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
bash <(curl -sL ${GIST_URL}) $@
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment