Created
June 7, 2013 18:11
-
-
Save zph/5731222 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
#!/bin/sh | |
choose_sack_implementation(){ | |
# If so, use prioritized wrapper | |
if [[ `which ag` ]]; then | |
command=`which sag`; | |
elif [[ `which ack` ]]; then | |
command=`which sack`; | |
elif [[ `which ack-grep` ]]; then | |
command=`which sack` | |
fi | |
} | |
choose_bare_bin_implementation(){ | |
if [[ `which ag` ]]; then | |
command=`which ag`; | |
elif [[ `which ack` ]]; then | |
command=`which ack`; | |
elif [[ `which ack-grep` ]]; then | |
command=`which ack`; | |
else | |
echo "No search tool found... install ag or ack (ack-grep) and also sack" | |
fi | |
} | |
# Check for sack scripts (ack wrapper) | |
if [[ `which sack` ]];then | |
choose_sack_implementation | |
else | |
choose_bare_bin_implementation | |
fi | |
$command 'TODO|FIXME|XXX|HACK' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment