Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Here is a sample config file with the default settings:

root: .
tmp_path: ./tmp
build_command: go
build_name: runner-build
build_log: runner-build-errors.log
valid_ext: .go, .tpl, .tmpl, .html
Expand Down
1 change: 1 addition & 0 deletions runner.conf.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
root: .
tmp_path: ./tmp
build_command: go
build_name: runner-build
build_log: runner-build-errors.log
valid_ext: .go, .tpl, .tmpl, .html
Expand Down
2 changes: 1 addition & 1 deletion runner/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func build() (string, bool) {
buildLog("Building...")

cmd := exec.Command("go", "build", "-o", buildPath(), root())
cmd := exec.Command(buildCommand(), "build", "-o", buildPath(), root())

stderr, err := cmd.StderrPipe()
if err != nil {
Expand Down
8 changes: 7 additions & 1 deletion runner/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var settings = map[string]string{
"config_path": "./runner.conf",
"root": ".",
"tmp_path": "./tmp",
"build_command": "go",
"build_name": "runner-build",
"build_log": "runner-build-errors.log",
"valid_ext": ".go, .tpl, .tmpl, .html",
Expand Down Expand Up @@ -68,7 +69,7 @@ func logColor(logName string) string {
}

func loadEnvSettings() {
for key, _ := range settings {
for key := range settings {
envKey := fmt.Sprintf("%s%s", envSettingsPrefix, strings.ToUpper(key))
if value := os.Getenv(envKey); value != "" {
settings[key] = value
Expand Down Expand Up @@ -113,9 +114,14 @@ func tmpPath() string {
return settings["tmp_path"]
}

func buildCommand() string {
return settings["build_command"]
}

func buildName() string {
return settings["build_name"]
}

func buildPath() string {
p := filepath.Join(tmpPath(), buildName())
if runtime.GOOS == "windows" && filepath.Ext(p) != ".exe" {
Expand Down