Here's a solution:
. "${TM_SUPPORT_PATH}/lib/bash_init.sh" "$TM_LILYPOND" "$TM_FILENAME" 2>&1 | pre
1) In TM2, bash_init.sh needs to be loaded? 2) In TM2, stdout and stderr are differentiated? (Lilypond writes to stderr, so combining it before the pipe to pre works. Wasn't needed, apparently, on TM1.5)
If anyone has better information or fix, please share.
Thanks! Charles
On 14 Dec 2011, at 18:41, Charles Turner wrote:
Here's a solution:
. "${TM_SUPPORT_PATH}/lib/bash_init.sh" "$TM_LILYPOND" "$TM_FILENAME" 2>&1 | pre
- In TM2, bash_init.sh needs to be loaded?
If the command has no shebang, it should work like 1.x (i.e. auto-source bash_init.sh).
Where can I see the full source for your bundle command?
- In TM2, stdout and stderr are differentiated? (Lilypond writes to
stderr, so combining it before the pipe to pre works. Wasn't needed, apparently, on TM1.5)
Yes, 1.x pretty much ignore command failures and output from stderr is just treated like stdout. In an attempt of providing better dialogs for actual failing commands, 2.0 now checks exit code from commands and treats stderr as erroneous output, so commands should be well behaved :)
On Wed, Dec 14, 2011 at 6:04 PM, Allan Odgaard mailinglist@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
On Dec 14, 2011, at 5:40 PM, Charles Turner 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...
Most all commands that use bash don't include a shebang line as bash was the default in 1.x. In 2.0 we always have a shebang line.
But because this command didn the sourcing wasn't done correctly.
I've just pushed an update to the command that fixes this issue, 2.0 should automatically pull the update within a few hours.