diff --git a/runner.conf.sample b/runner.conf.sample index 0d4364a..600dd07 100644 --- a/runner.conf.sample +++ b/runner.conf.sample @@ -2,6 +2,7 @@ root: . tmp_path: ./tmp build_name: runner-build build_log: runner-build-errors.log +run_flags: --test1=test1, --test2=test2 valid_ext: .go, .tpl, .tmpl, .html no_rebuild_ext: .tpl, .tmpl, .html ignored: assets, tmp diff --git a/runner/runner.go b/runner/runner.go index f15f89a..94907a8 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -8,7 +8,7 @@ import ( func run() bool { runnerLog("Running...") - cmd := exec.Command(buildPath()) + cmd := exec.Command(buildPath(), runFlags()...) stderr, err := cmd.StderrPipe() if err != nil { diff --git a/runner/settings.go b/runner/settings.go index 10117ec..89245a6 100644 --- a/runner/settings.go +++ b/runner/settings.go @@ -15,6 +15,7 @@ import ( const ( envSettingsPrefix = "RUNNER_" mainSettingsSection = "Settings" + runFlagsDelimeter = ", " ) var settings = map[string]string{ @@ -23,6 +24,7 @@ var settings = map[string]string{ "tmp_path": "./tmp", "build_name": "runner-build", "build_log": "runner-build-errors.log", + "run_flags": "", "valid_ext": ".go, .tpl, .tmpl, .html", "no_rebuild_ext": ".tpl, .tmpl, .html", "ignored": "assets, tmp", @@ -131,6 +133,10 @@ func buildErrorsFileName() string { return settings["build_log"] } +func runFlags() []string { + return strings.Split(settings["run_flags"], runFlagsDelimeter) +} + func buildErrorsFilePath() string { return filepath.Join(tmpPath(), buildErrorsFileName()) }