github.com/jacekolszak/noteo@v0.5.0/cmd/init.go (about)

     1  package cmd
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/jacekolszak/noteo/repository"
     7  	"github.com/spf13/cobra"
     8  )
     9  
    10  var initialize = &cobra.Command{
    11  	Use:   "init",
    12  	Short: "Initialize a Noteo repository",
    13  	RunE: func(cmd *cobra.Command, args []string) error {
    14  		cfgFile, err := repository.Init(".")
    15  		if err != nil {
    16  			return err
    17  		}
    18  		fmt.Printf("Repository initialized. Configuration file saved at %s\n", cfgFile)
    19  		return nil
    20  	},
    21  }