mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-13 20:18:52 +02:00
refactor: update import paths to use internal package
This commit is contained in:
@@ -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,
|
@@ -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"
|
@@ -1,4 +1,4 @@
|
||||
package cmd
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
@@ -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
16
cmd/cbzoptimizer/main.go
Normal 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()
|
||||
}
|
Reference in New Issue
Block a user