Created
January 5, 2012 06:44
-
-
Save kmaglione/1564050 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cmd$ = new shellCmd(); | |
function shellCmd() { | |
function runShellCommand(cmd,args) { | |
var file = Components.classes["@mozilla.org/file/local;1"] | |
.createInstance(Components.interfaces.nsILocalFile); | |
file.initWithPath(cmd); | |
if(file.exists()) { | |
var process = Components.classes["@mozilla.org/process/util;1"] | |
.createInstance(Components.interfaces.nsIProcess); | |
process.init(file); | |
process.run(true, args, args.length); | |
} | |
else { | |
alert(cmd + " doesn't exist; please update the correct path to the binary in the Settings menu"); | |
} | |
} | |
function runPerl(args) { | |
var perlPath = m$.getMuLTiFlowPref("perlPath"); | |
cmd$.runShellCommand(perlPath,args); | |
} | |
function runAbiword(args) { | |
var abiwordPath = m$.getMuLTiFlowPref("abiwordPath"); | |
runShellCommand(abiwordPath,args); | |
} | |
function runLaTeXML(args) { | |
var latexmlPath = m$.getMuLTiFlowPref("latexmlPath"); | |
runShellCommand(latexmlPath,args); | |
} | |
function runLaTeXMLpost(args) { | |
var latexmlpostPath = m$.getMuLTiFlowPref("latexmlPath") + "post"; | |
runShellCommand(latexmlpostPath,args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment