Sublime Forum

.sublime-build file is not picking up .bat file as cmd

#1

Hi there,

I got the ST2 v 2.0.1, and there is no “Groovy.sublime-build” comes with it. Can we add one in for future release?

Anyway, I tried to put one in myself, and thought this should work, but it didn’t.

{
	"cmd": "groovy", "$file"]
}

I’ve confirmed that I do have groovy.bat in my PATH already. To make it work, I had to add the “.bat” extension explicitly.

{
	"cmd": "groovy.bat", "$file"]
}

This is not very portable. Can we make ST2 more flexible to auto detect “.bat” in Windows as executable?

Thanks,
Zemian

0 Likes

#2

I found someone with a solution like this

{
    "cmd": "groovy","$file"],
    
    "windows":
    {
        "shell": "cmd.exe"
    }   
}

ref: gist.github.com/2203530

I am fine with this, but ST2 prob should make this more smoother as default for users. :smile:

0 Likes

#3

shell is a boolean (http://docs.sublimetext.info/en/latest/reference/build_systems.html), so

"shell" : true

must work as well.

And I suppose that you could use it for all OS, not only Windows:

{ "cmd": "groovy","$file"], "shell": true }

0 Likes

#4

I see that. I changed to “true” and it works. Thanks!

0 Likes