Use gitmedia.Print instead of fmt.Print

This commit is contained in:
rubyist 2014-06-03 17:17:43 -04:00
parent 56f8c84365
commit 2719233145

@ -22,14 +22,14 @@ func (c *InitCommand) Run() {
switch sub { switch sub {
case "hooks": case "hooks":
if err := c.hookInit(); err != nil { if err := c.hookInit(); err != nil {
fmt.Println(err) gitmedia.Print("%s", err)
return return
} }
default: default:
c.runInit() c.runInit()
} }
fmt.Println("git media initialized") gitmedia.Print("git media initialized")
} }
func (c *InitCommand) runInit() { func (c *InitCommand) runInit() {
@ -55,11 +55,11 @@ func setFilter(filterName string) {
existing := gitconfig.Find(key) existing := gitconfig.Find(key)
if shouldReset(existing) { if shouldReset(existing) {
fmt.Printf("Installing %s filter\n", filterName) gitmedia.Print("Installing %s filter", filterName)
gitconfig.UnsetGlobal(key) gitconfig.UnsetGlobal(key)
gitconfig.SetGlobal(key, value) gitconfig.SetGlobal(key, value)
} else if existing != value { } else if existing != value {
fmt.Printf("The %s filter should be \"%s\" but is \"%s\"\n", filterName, value, existing) gitmedia.Print("The %s filter should be \"%s\" but is \"%s\"", filterName, value, existing)
} }
} }
@ -72,7 +72,7 @@ func requireFilters() {
gitconfig.UnsetGlobal(key) gitconfig.UnsetGlobal(key)
gitconfig.SetGlobal(key, value) gitconfig.SetGlobal(key, value)
} else if existing != value { } else if existing != value {
fmt.Printf("Media filters should be required but are not") gitmedia.Print("Media filters should be required but are not")
} }
} }