mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-14 04:28:51 +02:00
refactor: change package name
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"github.com/belphemur/CBZOptimizer/cbz"
|
||||
"github.com/belphemur/CBZOptimizer/converter"
|
||||
"github.com/belphemur/CBZOptimizer/converter/constant"
|
||||
"github.com/belphemur/CBZOptimizer/packer"
|
||||
"github.com/belphemur/CBZOptimizer/manga"
|
||||
"github.com/spf13/cobra"
|
||||
"log"
|
||||
"os"
|
||||
@@ -21,7 +21,7 @@ func (m *MockConverter) Format() constant.ConversionFormat {
|
||||
return constant.WebP
|
||||
}
|
||||
|
||||
func (m *MockConverter) ConvertChapter(chapter *packer.Chapter, quality uint8, progress func(string)) (*packer.Chapter, error) {
|
||||
func (m *MockConverter) ConvertChapter(chapter *manga.Chapter, quality uint8, progress func(string)) (*manga.Chapter, error) {
|
||||
// Simulate conversion by setting the IsConverted flag
|
||||
chapter.IsConverted = true
|
||||
chapter.ConvertedTime = time.Now()
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user