Skip to content

Commit

Permalink
incorporate requested changes
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <[email protected]>
  • Loading branch information
dragonchaser committed Jun 27, 2024
1 parent 86529c8 commit 1697637
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ocis/pkg/command/trash.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TrashCommand(cfg *config.Config) *cli.Command {
Name: "trash",
Usage: "ocis trash functionality",
Subcommands: []*cli.Command{
TrashPurgeOrphanedDirsCommand(cfg),
TrashPurgeEmptyDirsCommand(cfg),
},
Before: func(c *cli.Context) error {
return configlog.ReturnError(parser.ParseConfig(cfg, true))
Expand All @@ -28,10 +28,10 @@ func TrashCommand(cfg *config.Config) *cli.Command {
}
}

func TrashPurgeOrphanedDirsCommand(cfg *config.Config) *cli.Command {
func TrashPurgeEmptyDirsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "purge-empty-dirs",
Usage: "purge orphaned directories",
Usage: "purge empty directories",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "basepath",
Expand All @@ -52,7 +52,7 @@ func TrashPurgeOrphanedDirsCommand(cfg *config.Config) *cli.Command {
return cli.ShowCommandHelp(c, "trash")
}

if err := trash.PurgeTrashOrphanedPaths(basePath, c.Bool("dry-run")); err != nil {
if err := trash.PurgeTrashEmptyPaths(basePath, c.Bool("dry-run")); err != nil {
fmt.Println(err)
return err
}
Expand Down
4 changes: 2 additions & 2 deletions ocis/pkg/trash/trash.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const (
_trashGlobPattern = "storage/users/spaces/*/*/trash/*/*/*/*"
)

// PurgeTrashOrphanedPaths purges orphaned paths in the trash
func PurgeTrashOrphanedPaths(p string, dryRun bool) error {
// PurgeTrashEmptyPaths purges empty paths in the trash
func PurgeTrashEmptyPaths(p string, dryRun bool) error {
// we have all trash nodes in all spaces now
dirs, err := filepath.Glob(filepath.Join(p, _trashGlobPattern))
if err != nil {
Expand Down

0 comments on commit 1697637

Please sign in to comment.