let PipeMediaCommand() figure out where the media commands live

This commit is contained in:
rick 2013-10-04 08:44:23 -06:00 committed by Rick Olson
parent 8b18f62242
commit 9cff651e50
2 changed files with 6 additions and 2 deletions

@ -9,14 +9,14 @@ type SmudgeCommand struct {
}
func (c *CleanCommand) Run() {
err := PipeCommand("bin/git-media-clean")
err := PipeMediaCommand("git-media-clean")
if err != nil {
panic(err)
}
}
func (c *SmudgeCommand) Run() {
err := PipeCommand("bin/git-media-smudge")
err := PipeMediaCommand("git-media-smudge")
if err != nil {
panic(err)
}

@ -53,6 +53,10 @@ func NewCommand(name, subname string) *Command {
return &Command{name, subname, flag.NewFlagSet(os.Args[0], flag.ExitOnError), args}
}
func PipeMediaCommand(name string, args ...string) error {
return PipeCommand("bin/"+name, args...)
}
func PipeCommand(name string, args ...string) error {
cmd := exec.Command(name, args...)
cmd.Stdin = os.Stdin