短片
这涉及 SciTE 和 Windows(特别是 Windows 7)中的 go 语言。这是我第一次使用 SciTE,所以如果有其他方法可以实现我的目标,那也很好。
目标:一键编译、链接和执行新创建的二进制文件。
龙
我想在 SciTE 的“go”命令下设置编译/链接/执行。这可能有点令人困惑,因为它也适用于 go language。 .这是我目前所拥有的:
command.compile.*.go=8g $(FileNameExt)
command.build.*.go=8l -o $(FileName).exe $(FileName).8
command.go.*.go=$(FileName).exe
我想要的是:
command.go.*.go=\
8g $(FileNamExt)\
8l -o $(FileName).exe $(FileName).8\
$(FileName).exe
如果这按我预期的方式工作,它将编译文件、链接它,然后运行可执行文件。发生的事情是:
8g hello.go8l -o hello.exe hello.8hello.exe
什么时候应该:
8g hello.go
8l -o hello.exe hello.8
hello.exe
每行的执行位置。
最佳答案
像这样写一个批处理脚本:
@echo off
if (%1 == "") (goto end)
set gofile=%1%
shift
8g %gofile%.go
8l -o %gofile%.exe %gofile%.8
%gofile%.exe
:end
批处理文件可以在任何地方,但假设它在 'C:\one\two\three\GO.bat' 中(不带引号)。在 SciTE 属性文件中更改:
command.go.*.go=$(FileName).exe
到
command.go.*.go=C:\one\two\three\GO.bat $(FileName)
当您按下 F5 键或单击“Go”时,它将编译、链接并执行该文件。
关于editor - SciTE 中的多行 command.go,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4503972/