Last active
November 24, 2015 20:52
-
-
Save ewindisch/45c47b60c7034f9e6662 to your computer and use it in GitHub Desktop.
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
function dockerfallback { | |
[ $? -eq 127 ] || return | |
IFS=', ' read -r -a ARGS <<< "$BASH_COMMAND" | |
if (docker images -q "$USER/${ARGS[0]}" 2>&1 >/dev/null); then | |
docker run --rm -it $USER/${ARGS[@]} | |
fi | |
} | |
trap dockerfallback ERR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment