Skip to content

Commit

Permalink
add build flags
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Feb 28, 2018
1 parent 16cb0da commit fab0ab1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package cmd

const Version = "1.3.3"
const Version = "1.4.0"
1 change: 1 addition & 0 deletions refresh/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type Configuration struct {
IncludedExtensions []string `yaml:"included_extensions"`
BuildTargetPath string `yaml:"build_target_path"`
BuildPath string `yaml:"build_path"`
BuildFlags []string `yaml:"build_flags"`
BuildDelay time.Duration `yaml:"build_delay"`
BinaryName string `yaml:"binary_name"`
CommandFlags []string `yaml:"command_flags"`
Expand Down
5 changes: 4 additions & 1 deletion refresh/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ func (r *Manager) build(event fsnotify.Event) {

now := time.Now()
r.Logger.Print("Rebuild on: %s", event.Name)
cmd := exec.Command(envy.Get("GO_BIN", "go"), "build", "-v", "-i", "-o", r.FullBuildPath(), r.BuildTargetPath)
args := []string{"build", "-v", "-i"}
args = append(args, r.BuildFlags...)
args = append(args, "-o", r.FullBuildPath(), r.BuildTargetPath)
cmd := exec.Command(envy.Get("GO_BIN", "go"), args...)
err := r.runAndListen(cmd)
if err != nil {
if strings.Contains(err.Error(), "no buildable Go source files") {
Expand Down

0 comments on commit fab0ab1

Please sign in to comment.