Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyCmd = &cobra.Command{ Use: "empty [path]", Short: "Recursively list empty folders on the PikPak server", Args: cobra.MaximumNArgs(1), Run: func(cmd *cobra.Command, args []string) { path := targetPath if len(args) > 0 { path = args[0] } p := api.NewPikPakWithContext(cmd.Context(), conf.Config.Username, conf.Config.Password) if err := p.Login(); err != nil { fmt.Println("Login failed") logx.Error(err) return } emptyFolders, err := handleEmptyFolders(cmd.Context(), &p, path, concurrency, deleteMode) if err != nil { if errors.Is(err, context.Canceled) { fmt.Println("Empty folder scan canceled") return } fmt.Println("Handle empty folders failed") logx.Error(err) return } if len(emptyFolders) == 0 { fmt.Printf("No empty folders found under %s\n", path) return } for _, folder := range emptyFolders { if deleteMode { fmt.Printf("Deleted empty folder: %s\n", folder) continue } fmt.Printf("Empty folder: %s\n", folder) } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.