Commit 3bf422d4 by Fred Smith

add automatic links based on source tree

parent 0f42b95a
......@@ -5,7 +5,7 @@
if [[ -d ~/links ]]; then
# autocomplete
complete -W "$(cd ~/links; ls -1)" j
complete -W "$(cd ~/links; ls -1; for FILE in ~/src/*/*/*; do if [[ -d "$FILE" ]]; then echo $FILE | sed -e 's/.*\///'; fi; done | sort)" j
# variables
......@@ -21,10 +21,16 @@ if [[ -d ~/links ]]; then
if [[ $? -eq 0 ]]; then
pushd "$REALDIR"
fi
else
REALDIR=$(pushd ~/links/*$1* > /dev/null && /usr/bin/env pwd -P && popd > /dev/null;)
if [[ $? -eq 0 ]]; then
pushd "$REALDIR"
else if [[ -L ~/links/*$1* ]]; then
REALDIR=$(pushd ~/links/*$1* > /dev/null && /usr/bin/env pwd -P && popd > /dev/null;)
if [[ $? -eq 0 ]]; then
pushd "$REALDIR"
fi
else
REALDIR=$(pushd ~/src/*/*/$1 > /dev/null && /usr/bin/env pwd -P && popd > /dev/null;)
if [[ $? -eq 0 ]]; then
pushd "$REALDIR"
fi
fi
fi
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment