GoSublime 9o multiple commands in build_command?

agolangf · 2016-05-04 20:40:22 · 1400 次点击    
这是一个分享于 2016-05-04 20:40:22 的资源,其中的信息可能已经有所发展或是发生改变。

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:

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.

prohulaelk:

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 && or reset 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.


入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

1400 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传