Home Download Buy Blog Forum Support

Build Systems And Opening Output

Build Systems And Opening Output

Postby SteveCooperOrg on Thu Sep 23, 2010 10:01 am

Hi, Guys. I wonder if anyone can help me find a neat solution to a problem.

I'm writing a command-line tool that takes a source file as a parameter, and writes XML to the console;

Code: Select all
> myexe.exe "c:\input.xml"
<xml>
  <!-- output here -->
</xml>


What I'd like to do is write a .sublime-build file which runs my command-line tool with the name of the current open file, and capture all the console output to a new unsaved buffer. Anyone know if this is possible?

I've tried directing the output to a file, but a build script like the following fails;

Code: Select all
build "myexe.exe" "C:\input.xml" "$File" ">" "c:\temp\out.xml"


Sublime X: Jon, Is this the sort of thing you could do more easily with the new buffer system in Sublime X?
Maybe what you're looking for is at the http://www.sublimetextwiki.com
SteveCooperOrg
 
Posts: 193
Joined: Thu Mar 20, 2008 9:53 am

Re: Build Systems And Opening Output

Postby jps on Fri Sep 24, 2010 9:59 am

I'd think the best way to do this is to ignore the .sublime-build file, and use Python's subprocess module directly. You can then append the output to a new buffer yourself (window.newFile() returns the created view, which should make this part of the process fairly simple).
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Vanishing and 26 guests