Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions src/MacVim/mvim
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,17 @@
# Bjorn Winckler (Aug 13 2007).

# Find Vim executable
if [ -L "$0" ]; then
# readlink -f
curdir=`pwd -P`
self_path=$0
cd "`dirname $self_path`"
while [ -L "$self_path" ]; do
self_path=`readlink $self_path`
cd "`dirname $self_path`"
self_path=`basename $self_path`
done
binary="`pwd -P`/../MacOS/Vim"
cd "$curdir"
else
binary="`dirname "$0"`/../MacOS/Vim"
fi
orig_path="$(pwd -P)"
self_path="$0"
while [ -L "$self_path" ]; do # dereference links
link="$(basename "$self_path")"
cd "$(dirname "$self_path")"
self_path="$(readlink "$link")"
done
cd "$(dirname "$self_path")"
binary="$(dirname "$(pwd -P)")/MacOS/Vim"
cd "$orig_path"

if ! [ -x "$binary" ]; then
echo "Sorry, cannot find Vim executable."
exit 1
Expand Down