refactor: change package name

This commit is contained in:
Antoine Aflalo
2024-08-27 13:27:50 -04:00
parent 9083ec599a
commit 634f13582e
13 changed files with 122 additions and 49 deletions

View File

@@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"os"
)
@@ -11,6 +12,17 @@ var rootCmd = &cobra.Command{
Short: "Convert CBZ files using a specified converter",
}
func init() {
viper.SetConfigName("CBZOptimizer")
viper.SetConfigType("yaml")
viper.SetEnvPrefix("CBZ")
viper.AutomaticEnv()
err := viper.ReadInConfig() // Find and read the config file
if err != nil { // Handle errors reading the config file
panic(fmt.Errorf("fatal error config file: %w", err))
}
}
// Execute executes the root command.
func Execute() {
if err := rootCmd.Execute(); err != nil {