]> git.lyx.org Git - lyx.git/blob - development/MacOSX/lilypond-book
Const
[lyx.git] / development / MacOSX / lilypond-book
1 #!/bin/bash
2
3 # \file lilypond-book
4 # wrapper start script for LilyPond.app on Mac
5 #
6 # This file is part of LyX, the document processor.
7 # Licence details can be found in the file COPYING.
8 #
9 # \author Stephan Witt
10 # Full author contact details are available in file CREDITS.
11
12 unset DISPLAY
13
14 LYXDIR=$(dirname "${0}")
15 # try to find the lilypond-book installation...
16 # at first try the well known location for LilyPond 2.x
17 # in case this failes try PATH expansion to start the lilypond-book shell wrapper
18 IFS=":" read -ra DIRLIST <<< "${PATH}"
19 for BINDIR in "/Applications/LilyPond.app/Contents/Resources/bin" "${DIRLIST[@]}" ; do
20         BDIR=$(dirname "${BINDIR}/x")
21         if [ "${BDIR}" != "${LYXDIR}" -a -x "${BINDIR}"/lilypond-book ]; then
22                 exec "${BINDIR}"/lilypond-book "$@"
23                 exit 0
24         fi
25 done
26 # report error and exit with failure status
27 echo Could not find LilyPond binary.
28 exit 1