Skip to content

Commit b567869

Browse files
authored
Merge pull request #28 from gomicro/remove-local-fmt
delete fmt package
2 parents b7d9bb5 + b4e2068 commit b567869

3 files changed

Lines changed: 8 additions & 31 deletions

File tree

cmd/root.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"github.com/spf13/viper"
1010

1111
"github.com/gomicro/forge/confile"
12-
clifmt "github.com/gomicro/forge/fmt"
1312
)
1413

1514
func init() {
@@ -18,28 +17,28 @@ func init() {
1817
RootCmd.PersistentFlags().Bool("verbose", false, "show more verbose output")
1918
err := viper.BindPFlag("verbose", RootCmd.PersistentFlags().Lookup("verbose"))
2019
if err != nil {
21-
clifmt.Printf("Error setting up: %v\n", err.Error())
20+
fmt.Printf("Error setting up: %s\n", err)
2221
os.Exit(1)
2322
}
2423

2524
RootCmd.PersistentFlags().Bool("solo", false, "run a step solo, without its pre or post steps")
2625
err = viper.BindPFlag("solo", RootCmd.PersistentFlags().Lookup("solo"))
2726
if err != nil {
28-
clifmt.Printf("Error setting up: %v\n", err.Error())
27+
fmt.Printf("Error setting up: %s\n", err)
2928
os.Exit(1)
3029
}
3130

3231
RootCmd.PersistentFlags().Bool("no-pre", false, "skip running pre steps")
3332
err = viper.BindPFlag("no-pre", RootCmd.PersistentFlags().Lookup("no-pre"))
3433
if err != nil {
35-
clifmt.Printf("Error setting up: %v\n", err.Error())
34+
fmt.Printf("Error setting up: %s\n", err)
3635
os.Exit(1)
3736
}
3837

3938
RootCmd.PersistentFlags().Bool("no-post", false, "skip running post steps")
4039
err = viper.BindPFlag("no-post", RootCmd.PersistentFlags().Lookup("no-post"))
4140
if err != nil {
42-
clifmt.Printf("Error setting up: %v\n", err.Error())
41+
fmt.Printf("Error setting up: %s\n", err)
4342
os.Exit(1)
4443
}
4544
}
@@ -54,15 +53,13 @@ var RootCmd = &cobra.Command{
5453
Long: `Forge is a CLI tool for executing, in a consistent manner, scripts and commands for building and maintaining projects.`,
5554
Args: cobra.MinimumNArgs(1),
5655
RunE: rootFunc,
57-
SilenceErrors: true,
5856
ValidArgsFunction: validArgsFunc,
5957
}
6058

6159
// Execute adds all child commands to the root command and sets flags appropriately.
6260
// This is called by main.main(). It only needs to happen once to the rootCmd.
6361
func Execute() {
6462
if err := RootCmd.Execute(); err != nil {
65-
clifmt.Printf("Failed to execute: %v\n", err.Error())
6663
os.Exit(1)
6764
}
6865
}

cmd/version.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package cmd
22

33
import (
4-
"github.com/spf13/cobra"
4+
"fmt"
55

6-
"github.com/gomicro/forge/fmt"
6+
"github.com/spf13/cobra"
77
)
88

99
func init() {
@@ -25,8 +25,8 @@ var versionCmd = &cobra.Command{
2525

2626
func versionFunc(cmd *cobra.Command, args []string) {
2727
if Version == "" {
28-
fmt.Printf("Forge version dev-local")
28+
fmt.Printf("Forge version dev-local\n")
2929
} else {
30-
fmt.Printf("Forge version %v", Version)
30+
fmt.Printf("Forge version %v\n", Version)
3131
}
3232
}

fmt/fmt.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)