Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to specify a build target directory - useful if for examp… #12

Merged
merged 2 commits into from
Jun 29, 2017
Merged
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 cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var initCmd = &cobra.Command{
AppRoot: ".",
IgnoredFolders: []string{"vendor", "log", "logs", "tmp", "node_modules", "bin", "templates"},
IncludedExtensions: []string{".go"},
BuildTargetPath: "",
BuildPath: os.TempDir(),
BuildDelay: 200,
BinaryName: "refresh-build",
Expand Down
1 change: 1 addition & 0 deletions refresh/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Configuration struct {
AppRoot string `yaml:"app_root"`
IgnoredFolders []string `yaml:"ignored_folders"`
IncludedExtensions []string `yaml:"included_extensions"`
BuildTargetPath string `yaml:"build_target_path"`
BuildPath string `yaml:"build_path"`
BuildDelay time.Duration `yaml:"build_delay"`
BinaryName string `yaml:"binary_name"`
Expand Down
2 changes: 1 addition & 1 deletion refresh/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (r *Manager) build(events []fsnotify.Event) {

now := time.Now()
r.Logger.Print("Rebuild on: %s", strings.Join(eventNames, ", "))
cmd := exec.Command("go", "build", "-v", "-i", "-o", r.FullBuildPath())
cmd := exec.Command("go", "build", "-v", "-i", "-o", r.FullBuildPath(), r.Configuration.BuildTargetPath)
err := r.runAndListen(cmd)
if err != nil {
if strings.Contains(err.Error(), "no buildable Go source files") {
Expand Down