Permalink
Browse files

Support for requiredCommands.

  • Loading branch information...
1 parent 46b29f6 commit 371097dfbda2670db6c0352b62b84e48468298e4 @infininight infininight committed Nov 14, 2011
Showing with 30 additions and 6 deletions.
  1. +30 −6 Commands/Gri and view.plist
View
36 Commands/Gri and view.plist
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>command</key>
- <string># Run Gri, convert the PostScript to PDF, and then show the latter.
+ <string>#!/usr/bin/env bash
+[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] &amp;&amp; . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
+
+# Run Gri, convert the PostScript to PDF, and then show the latter.
# The code is patterned on that for the "LaTeX and view" command.
# GPL 2005 Dan Kelley.
# (I hope it's OK to GPL something in TM!)
@@ -18,7 +21,6 @@
# default option.
V=${TM_LATEX_VIEWER:=html}
-GRI=gri
DIR=`dirname "$TM_FILEPATH"`
FILE=`basename "$TM_FILEPATH"`
PSFILE=`basename "$FILE" .gri`.ps
@@ -43,7 +45,7 @@ close() {
# Compile. Bail out on errors.
echo "gri -output ${DIR}/${PSFILE} ${TM_FILEPATH}";
echo "&lt;BR&gt;";
-gri -output "${DIR}/${PSFILE}" "${TM_FILEPATH}";
+"${TM_GRI:-gri}" -output "${DIR}/${PSFILE}" "${TM_FILEPATH}";
RC=$?
if (($RC != 0)); then exit; fi
echo "${TOPDF} ${DIR}/$PSFILE ${DIR}/$PDFFILE";
@@ -71,15 +73,37 @@ fi
</string>
<key>input</key>
<string>none</string>
+ <key>inputFormat</key>
+ <string>text</string>
<key>keyEquivalent</key>
<string>@b</string>
<key>name</key>
<string>Gri and View</string>
- <key>output</key>
- <string>showAsHTML</string>
+ <key>outputCaret</key>
+ <string>afterOutput</string>
+ <key>outputFormat</key>
+ <string>html</string>
+ <key>outputLocation</key>
+ <string>newWindow</string>
+ <key>requiredCommands</key>
+ <array>
+ <dict>
+ <key>command</key>
+ <string>gri</string>
+ <key>locations</key>
+ <array>
+ <string>/opt/local/bin/gri</string>
+ <string>/usr/local/bin/gri</string>
+ </array>
+ <key>variable</key>
+ <string>TM_GRI</string>
+ </dict>
+ </array>
<key>scope</key>
<string>source.gri</string>
<key>uuid</key>
<string>41A8F343-48CB-482E-A395-34C31CE9A5AB</string>
+ <key>version</key>
+ <integer>2</integer>
</dict>
</plist>

0 comments on commit 371097d

Please sign in to comment.