I’m trying to write a build system for Sublime Text, but for some reason it’s not working. First of all, I’d like to say that the information at sublimetext.com/docs/build seems out of date, and is only misleading.
Anyway, I’m trying to write a build system for CleanCSS. This requires me to run a command like this:
python -m cleancss file.ccss > file.css
This is my attempt:
"cmd": "python2.7 -m cleancss $file > $basename.css"],
However, when I hit CMD-B (I’m on a mac), I get this error:
So I open up the console to see what’s going on, and I find this:
As you can see, the filename to output to is missing, and it’s trying to write to the file “.css”. However, this is not the error. I tried removing the “> $basename.css” part, and still get the “No such file or directory” error. The console says this:
See the error? There is none. When I copy this exact command into terminal, it works exactly like expected, but Sublime Text says “no such file”. It gets even weirder: if I run cleancss in terminal with an invalid file, I get this:
$ python2.7 -m cleancss foo
[Errno 2] No such file or directory: 'foo'
The difference is that it says what is actually invalid; in this case, “foo”. When building in sublime text, it only says “[Errno 2] No such file or directory”. The logical thing would be that sublime text does not supply a file at all, but this is not correct, then cleancss would print a usage message.
Are anyone able to shed some light on this issue? Hope I’m not confusing you too much.