diff --git a/cmd/done.go b/cmd/done.go index 1ed6a08..661f0fc 100644 --- a/cmd/done.go +++ b/cmd/done.go @@ -1,8 +1,6 @@ package cmd import ( - "fmt" - "github.com/spf13/cobra" ) @@ -12,10 +10,6 @@ var doneCmd = &cobra.Command{ Long: "Do add commit and push at one go. Example usage: okgit done", Run: func(cmd *cobra.Command, args []string) { - fmt.Println("--------------") - fmt.Println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.") - fmt.Println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.") - fmt.Println("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.") addCmd.Run(cmd, args) commitCmd.Run(cmd, args) pushCmd.Run(cmd, args) diff --git a/cmd/pull.go b/cmd/pull.go index 3066a96..4fbe998 100644 --- a/cmd/pull.go +++ b/cmd/pull.go @@ -43,9 +43,10 @@ var pullCmd = &cobra.Command{ gitPull.Arguments = append(gitPull.Arguments, string(branch)) cmdOut, cmdErr = utils.RunCommand(gitPull.Name, gitPull.Arguments, "") if cmdErr != nil { - utils.LogFatal(cmdErr) + utils.LogNonFatal(cmdErr) + } else { + utils.LogOutput(cmdOut) } - utils.LogOutput(cmdOut) }, } diff --git a/cmd/root.go b/cmd/root.go index e9c306b..a080f71 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,7 +17,7 @@ var rootCmd = &cobra.Command{ // Uncomment the following line if your bare application // has an action associated with it: // Run: func(cmd *cobra.Command, args []string) { }, - Version: "1.0.15", + Version: "1.0.18", } // Execute adds all child commands to the root command and sets flags appropriately. diff --git a/utils/fs.go b/utils/fs.go index 53b05aa..b728b51 100644 --- a/utils/fs.go +++ b/utils/fs.go @@ -174,6 +174,12 @@ func LogFatal(err error) { log.Fatal(red(err.Error())) } } +func LogNonFatal(err error) { + if err != nil { + red := color.New(color.FgRed).SprintFunc() + log.Print(red(err.Error())) + } +} func LogOutput(output string) { if output != "" {