Created
March 14, 2017 23:14
-
-
Save ianloic/d7ed67818c560b3e1892d9671c657c82 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
#autoload | |
# Hack to replace _path_files with one that expands // and then calls the | |
# original. | |
local fdir ffile original found_one | |
# Look for the second _path_files in the $fpath | |
for fdir in $fpath; do | |
ffile=$fdir/$0 | |
if [[ -e $ffile ]]; then | |
if [[ -z $found_one ]]; then | |
found_one=true | |
else | |
original=$ffile | |
break | |
fi | |
fi | |
done | |
if [[ $PREFIX = //* ]]; then | |
# When we get // replace it with $FUCHSIA_DIR | |
PREFIX=${PREFIX:s/\/\//${HOME}\/} | |
source $original $* | |
else | |
source $original $* | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment