<p>I'm trying to use multiple commands in my build_command setting, but it doesn't appear to be working:</p>
<pre><code>"build_command": ["reset && go run $_fn"],
"build_command": ["reset" "go run $_fn"],
</code></pre>
<p>Has anybody else tried this?</p>
<hr/>**评论:**<br/><br/>hi_im_nate: <pre><p>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. </p></pre>prohulaelk: <pre><p>from the default settings' comments, it looks like you'd need to quote-and-comma separate each arg; something more like <code>["reset", "&&", "go", "run", "$_fn"]</code>:</p>
<pre><code>// 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"],
</code></pre>
<p>9o.md doesn't list anything about supporting <code>&&</code> or <code>reset</code> though, so not sure if even that'll work.</p>
<p>You might need to make your own build system, eg. mine is:</p>
<pre><code>{
"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"}
]
}
</code></pre>
<p>the cmd arguments there should support anything your OS' default shell does.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传