I'm trying to use multiple commands in my build_command setting, but it doesn't appear to be working:
"build_command": ["reset && go run $_fn"],
"build_command": ["reset" "go run $_fn"],
Has anybody else tried this?
评论:
hi_im_nate:
prohulaelk:I'm not sure how sublime does its execution, but you may need to have a shell open to run multiple things like that. Try adding the commands into a script and running that script as your build command.
from the default settings' comments, it looks like you'd need to quote-and-comma separate each arg; something more like
["reset", "&&", "go", "run", "$_fn"]
:// what 9o command to run when (super or )ctrl+dot,ctrl+b us pressed // e.g. ["go", "build"] // the 9o command ^1 recalls the last command you ran manually // see 9o help(ctrl+9 "help") for more details about what commands are supported "build_command": ["^1"],
9o.md doesn't list anything about supporting
&&
orreset
though, so not sure if even that'll work.You might need to make your own build system, eg. mine is:
{ "cmd": "go run $file", "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.go", "shell": "true", "variants": [ {"name": "Go Test", "cmd": "go test $file"}, {"name": "Go Build", "cmd": "go build $file"} ] }
the cmd arguments there should support anything your OS' default shell does.
