Created
June 25, 2014 20:12
-
-
Save tsibley/b0250a2c07339105dc30 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# | |
# Potentially re-exec commands inside the current directory's carton | |
# environment. | |
# | |
# Usage: alias perldoc='maybe-via-carton perldoc' | |
# | |
cmd=$1 | |
shift | |
if [[ -f cpanfile.snapshot && -d local ]] && which carton >/dev/null 2>/dev/null; then | |
echo running inside carton >&2 | |
exec carton exec -- $cmd "$@" | |
else | |
exec $cmd "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment