Home Download Buy Blog Forum Support

Any way to build without saving file first

Any way to build without saving file first

Postby indiver on Thu May 05, 2011 9:30 am


I've got my Coffeescript builder going, which looks like this:

Code: Select all
   "cmd": ["coffee", "$file"],
   "selector": "source.coffee"

However, is there any way for me to type coffeescript code in an an unsaved file, and run the builder on it?

(I switch the syntax of the unsaved file to coffeescript, so Sublime knows that it is a coffeescript file).

Currently, when I run the builder on an unsaved document I get this error:

Code: Select all
            throw new Error("File not found: " + source);
Error: File not found:
    at /Users/indy/Development/Node/lib/node_modules/coffee-script/lib/command.js:66:19
    at path.js:395:19

I can see why this would happen as the file doesn't exist. But I'm unable to find the correct variable to add in the coffeescript builder. I've seen the variables listed at: http://www.sublimetext.com/docs/build, but none seems to fit the bill.

Essentially what needs to happen is that if the file is unsaved, and a builder is run on it, it needs to be run from a temporary folder (like TextMate does).

Is this possible at all?


Posts: 30
Joined: Fri Mar 04, 2011 5:40 am
Location: Auckland, New Zealand

Re: Any way to build without saving file first

Postby LeChuck on Tue May 17, 2011 5:13 pm

That's something I would like as well, to be able to build and validate without having to save the latest changes to the original file first. If you've been working on a file and you run the build, the output won't refresh unless you save the file again.
Posts: 2
Joined: Tue May 17, 2011 5:11 pm

Return to Technical Support

Who is online

Users browsing this forum: rgidney and 15 guests