Refactor structure, use cobra

This commit is contained in:
Ben Sarmiento
2023-11-29 23:05:08 +01:00
parent 70550ea57c
commit ced99b9667
10 changed files with 158 additions and 99 deletions

View File

@@ -2,7 +2,6 @@ package torrent
import (
"fmt"
"os"
)
func getFileIDs(files []File) []string {
@@ -14,15 +13,3 @@ func getFileIDs(files []File) []string {
}
return fileIDs
}
func ensureDir(dirName string) error {
if _, err := os.Stat(dirName); os.IsNotExist(err) {
err := os.Mkdir(dirName, 0755)
if err != nil {
return err
}
} else if err != nil {
return err
}
return nil
}