Skip to content

Commit

Permalink
feat: check if banner file exists or not
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalcaliskan committed Mar 15, 2023
1 parent 181bf55 commit dfb7c4e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ var rootCmd = &cobra.Command{
Short: "",
Long: ``,
Version: ver.GitVersion,
Run: func(cmd *cobra.Command, args []string) {
/*bannerBytes, _ := ioutil.ReadFile("banner.txt")
banner.Init(os.Stdout, true, false, strings.NewReader(string(bannerBytes)))*/
PersistentPreRun: func(cmd *cobra.Command, args []string) {
/*if _, err := os.Stat("build/ci/banner.txt"); err == nil {
bannerBytes, _ := os.ReadFile("build/ci/banner.txt")
banner.Init(os.Stdout, true, false, strings.NewReader(string(bannerBytes)))
}*/

logging.GetLogger().Info("golang-cli-template is started",
zap.String("appVersion", ver.GitVersion),
Expand Down

0 comments on commit dfb7c4e

Please sign in to comment.