Last active
October 16, 2018 22:53
-
-
Save stephenmm/48b5912d6c893dd6b077c793c8474fe5 to your computer and use it in GitHub Desktop.
A quick bash script to allow quick indexing of new codebase. Just add this script to the root of the codebase (and then source it of course).
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
source_file=`pwd`/${BASH_SOURCE[0]} | |
source_root=$( readlink -f $( dirname $source_file ) ) | |
# Setup so we can easily search the codebase with csearch/cindex | |
# Make sure csearch and cindex are installed first | |
if type cindex >/dev/null 2>&1; then | |
export CSEARCHINDEX=$source_root/.csearchindex.local | |
if [[ ! -f $CSEARCHINDEX ]]; then | |
cindex $source_root | |
fi | |
else | |
echo "[WARN] Need to install cindex/csearch in order to index this codebase. Ex: > git clone https://github.com/google/codesearch" | |
fi | |
echo '[INFO] If this is a "c" based codebase you could also run "cscope -R *" to create tags which will also help you explore the code.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment