refactor: update import paths to use internal package

This commit is contained in:
Antoine Aflalo
2025-02-13 19:39:06 -05:00
parent 5428134d15
commit dd7b6a332c
25 changed files with 54 additions and 54 deletions

View File

@@ -1,10 +1,10 @@
package cmd
package commands
import (
"fmt"
"github.com/belphemur/CBZOptimizer/v2/converter"
"github.com/belphemur/CBZOptimizer/v2/converter/constant"
"github.com/belphemur/CBZOptimizer/v2/utils"
utils2 "github.com/belphemur/CBZOptimizer/v2/internal/utils"
"github.com/belphemur/CBZOptimizer/v2/pkg/converter"
"github.com/belphemur/CBZOptimizer/v2/pkg/converter/constant"
"github.com/spf13/cobra"
"github.com/thediveo/enumflag/v2"
"os"
@@ -45,7 +45,7 @@ func ConvertCbzCommand(cmd *cobra.Command, args []string) error {
return fmt.Errorf("path is required")
}
if !utils.IsValidFolder(path) {
if !utils2.IsValidFolder(path) {
return fmt.Errorf("the path needs to be a folder")
}
@@ -92,7 +92,7 @@ func ConvertCbzCommand(cmd *cobra.Command, args []string) error {
go func() {
defer wg.Done()
for path := range fileChan {
err := utils.Optimize(&utils.OptimizeOptions{
err := utils2.Optimize(&utils2.OptimizeOptions{
ChapterConverter: chapterConverter,
Path: path,
Quality: quality,

View File

@@ -1,11 +1,11 @@
package cmd
package commands
import (
"github.com/belphemur/CBZOptimizer/v2/cbz"
"github.com/belphemur/CBZOptimizer/v2/converter"
"github.com/belphemur/CBZOptimizer/v2/converter/constant"
"github.com/belphemur/CBZOptimizer/v2/manga"
"github.com/belphemur/CBZOptimizer/v2/utils/errs"
"github.com/belphemur/CBZOptimizer/v2/internal/cbz"
"github.com/belphemur/CBZOptimizer/v2/internal/manga"
"github.com/belphemur/CBZOptimizer/v2/internal/utils/errs"
"github.com/belphemur/CBZOptimizer/v2/pkg/converter"
"github.com/belphemur/CBZOptimizer/v2/pkg/converter/constant"
"github.com/spf13/cobra"
"log"
"os"

View File

@@ -1,4 +1,4 @@
package cmd
package commands
import (
"fmt"

View File

@@ -1,10 +1,10 @@
package cmd
package commands
import (
"fmt"
"github.com/belphemur/CBZOptimizer/v2/converter"
"github.com/belphemur/CBZOptimizer/v2/converter/constant"
"github.com/belphemur/CBZOptimizer/v2/utils"
utils2 "github.com/belphemur/CBZOptimizer/v2/internal/utils"
"github.com/belphemur/CBZOptimizer/v2/pkg/converter"
"github.com/belphemur/CBZOptimizer/v2/pkg/converter/constant"
"github.com/pablodz/inotifywaitgo/inotifywaitgo"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@@ -53,7 +53,7 @@ func WatchCommand(_ *cobra.Command, args []string) error {
return fmt.Errorf("path is required")
}
if !utils.IsValidFolder(path) {
if !utils2.IsValidFolder(path) {
return fmt.Errorf("the path needs to be a folder")
}
@@ -114,7 +114,7 @@ func WatchCommand(_ *cobra.Command, args []string) error {
for _, e := range event.Events {
switch e {
case inotifywaitgo.CLOSE_WRITE, inotifywaitgo.MOVE:
err := utils.Optimize(&utils.OptimizeOptions{
err := utils2.Optimize(&utils2.OptimizeOptions{
ChapterConverter: chapterConverter,
Path: event.Filename,
Quality: quality,

16
cmd/cbzoptimizer/main.go Normal file
View File

@@ -0,0 +1,16 @@
package main
import (
"github.com/belphemur/CBZOptimizer/v2/cmd/cbzoptimizer/commands"
)
var (
version = "dev"
commit = "none"
date = "unknown"
)
func main() {
commands.SetVersionInfo(version, commit, date)
commands.Execute()
}