Skip to content

Instantly share code, notes, and snippets.

@ianloic
Created March 14, 2017 23:14
Show Gist options
  • Save ianloic/d7ed67818c560b3e1892d9671c657c82 to your computer and use it in GitHub Desktop.
Save ianloic/d7ed67818c560b3e1892d9671c657c82 to your computer and use it in GitHub Desktop.
#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