[TxMt] Re: SOLVED Re: TextMate 2 can't find "pre" in Lilypond bundle
Charles Turner
vze26m98 at gmail.com
Wed Dec 14 23:40:36 UTC 2011
On Wed, Dec 14, 2011 at 6:04 PM, Allan Odgaard <mailinglist at textmate.org> wrote:
> If the command has no shebang, it should work like 1.x (i.e. auto-source bash_init.sh).
Interesting. From what I can tell, my copy in "Pristine" (the copy 1.5
uses, correct?) also has a shebang, but it was able to find
bash_init.sh/pre...
> Where can I see the full source for your bundle command?
It's the ⌘R (Engrave & View) for the Lilypond.tmbundle in "Managed
Bundles". This is the unmodified source:
#!/bin/bash
#
# beforeRunningCommand: saveActiveFile
# input: none
# keyEquivalent: @r
# name: Engrave and View
# output: showAsHTML
# scope: source.lilypond
# uuid: E8B6A543-90A6-46A4-A307-B21B67EF7F2F
#
. "${TM_SUPPORT_PATH}/lib/webpreview.sh"
html_header 'Engrave & View' "$TM_FILENAME"
echo '<h2>Engraving…</h2>'
: ${TM_LILYPOND:="$(find_app Lilypond.app)/Contents/Resources/bin/lilypond"}
[[ ! -f "$TM_LILYPOND" ]] && TM_LILYPOND=lilypond
if ! type >/dev/null -p "$TM_LILYPOND"; then
echo "Error locating <a
href='http://lilypond.org/web/'>lilypond</a> on your system."
exit
fi
cd "$TM_DIRECTORY"
"$TM_LILYPOND" "$TM_FILENAME" | pre
if [[ -f "${TM_FILEPATH%.*}.pdf" ]];
then echo "Opening PDF…"; open "${TM_FILEPATH%.*}.pdf"
else echo "Error generating PDF file."
fi
More information about the textmate
mailing list