Sublime Forum

Impossible to add key binding for build system varient

#1

All I want is a key binding to one of my build commands (so-called “variant”).

I have a build system for JS which looks like this:

{
	"shell_cmd": "node \"$file\"; echo;",
	"selector": "source.js",
	"variants": 
		{
			"name": "Test",
			"shell_cmd": "mocha"
		}
	]
}

I want to add a key binding to run Test. Searched alllll over the place. Saw lots of old stuff that doesn’t work anymore, and lots of incomplete answers, like this one:
stackoverflow.com/questions/1183 … tab=active

This is what the console says when I run the build system “variant” from the command palette:
command: build {“variant”: “Test”}

Tried a ton of variations on this until I figured it out, only to find it does nothing at all:
sublime.run_command(“build”, {“variant”: “Test”})

sublime.run_command(“build”, {“variant”: “Test”})

Apparently Shell Turtlestein and MultiTaskBuild are both not being updated to work with ST3.
viewtopic.php?f=3&t=2897&p=14171&hilit=key+binding+build+script#p14171

0 Likes