let PipeMediaCommand() figure out where the media commands live
This commit is contained in:
parent
8b18f62242
commit
9cff651e50
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user