Created
May 5, 2020 16:24
-
-
Save snown/af078b5e98c91c66750b539a64a0e7d7 to your computer and use it in GitHub Desktop.
Dynamic Bashful
This file contains 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
#!/usr/bin/env bash | |
function bashful { | |
( | |
local bashful_path="$(find /tmp/ -name "jmcantrell-bashful-*" -print -quit 2>/dev/null)" | |
if [[ -z ${bashful_path:+x} ]]; then | |
curl -fsSL https://github.com/jmcantrell/bashful/tarball/master | tar xz -C /tmp/ | |
bashful_path="$(find /tmp/ -name "jmcantrell-bashful-*" -print -quit 2>/dev/null)" | |
fi | |
if [[ -z ${bashful_path:+x} ]]; then | |
echo "Couldn't find bashful" | |
exit 1 | |
fi | |
pushd "${bashful_path}"/bin/ >/dev/null | |
source "${bashful_path}/bin/bashful" | |
popd >/dev/null | |
"$@" | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment