Skip to content

Commit

Permalink
Merge pull request #381 from bozaro/blinking
Browse files Browse the repository at this point in the history
Windows: hide git application window.
  • Loading branch information
technoweenie committed Jun 17, 2015
2 parents a444aaa + ab20cae commit 07c3844
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (c *gitConfig) Version() (string, error) {
// simpleExec is a small wrapper around os/exec.Command.
func simpleExec(name string, args ...string) (string, error) {
tracerx.Printf("run_command: '%s' %s", name, strings.Join(args, " "))
cmd := exec.Command(name, args...)
cmd := execCommand(name, args...)

output, err := cmd.Output()
if _, ok := err.(*exec.ExitError); ok {
Expand Down
13 changes: 13 additions & 0 deletions git/git_nix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// +build !windows

// Package git contains various commands that shell out to git
package git

import (
"os/exec"
)

// execCommand is a small platform specific wrapper around os/exec.Command
func execCommand(name string, arg ...string) *exec.Cmd {
return exec.Command(name, arg...)
}
16 changes: 16 additions & 0 deletions git/git_win.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// +build windows

// Package git contains various commands that shell out to git
package git

import (
"os/exec"
"syscall"
)

// execCommand is a small platform specific wrapper around os/exec.Command
func execCommand(name string, arg ...string) *exec.Cmd {
cmd := exec.Command(name, arg...)
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
return cmd
}

0 comments on commit 07c3844

Please sign in to comment.