25 lines
393 B
Go
25 lines
393 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"git-roast/internal/roast"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var initCmd = &cobra.Command{
|
|
Use: "init",
|
|
Short: "Initialize a new git-roast repository.",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
if err := roast.Init(); err != nil {
|
|
_, _ = fmt.Fprintln(os.Stderr, err.Error())
|
|
os.Exit(1)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(initCmd)
|
|
}
|