Sublime Forum

sublime2 key binding command exec

#1

I looked for documentation but couldn’t find any help on this.
Here’s what I’m trying


{ "keys": "ctrl+shift+b"], "command": "exec","cmd": "ant","build"]}
]

But I’m getting

[Error 87] The parameter is incorrect
[Finished]

Is there a way I can debug/troubleshoot or get a clue from someone on how to work this out?

0 Likes

Auto build when saving a particular file type or buffer?
Need help converting ST1 preferences to ST2 format
#2

You need to wrap the arguments within “args”:


    { "keys": "ctrl+shift+b"], "command": "exec", "args": { "cmd": "ant","build"]} }
]
0 Likes

#3

Okay, I’m getting the error:

And Ant is in my PATH (win7) - should it be set elsewhere as well?

Thanks.

0 Likes

#4

3 things to try:

  • Verify the command that’s being run by looking in the console.
  • Test that typing ‘ant’ in a command prompt works
  • Ensure you’ve restarted Sublime Text since adjusting your path
0 Likes

#5
Running ant

Yup ant works on the command prompt just fine.

Unfortunately no change. I’m still getting

[Error 2] The system cannot find the file specified
[Finished]

Edit: BTW the same error occurs when using the F7 Ant Build tool.

Maybe someone could chime in and confirm this por favor?

0 Likes

#6

Try changing ‘ant’ to ‘ant.bat’

0 Likes

#7

Of course that was it!

{ "keys": "ctrl+shift+b"], "command": "exec", "args": { "cmd": "ant.bat"]} }

Thanks.

0 Likes