Skip to content

Commit

Permalink
add condition in custom
Browse files Browse the repository at this point in the history
  • Loading branch information
Laure-di committed Oct 1, 2024
1 parent 829c8e8 commit 13fcdb2
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 12 deletions.
46 changes: 34 additions & 12 deletions internal/namespaces/object/v1/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,40 @@ func GetCommands() *core.Commands {
human.RegisterMarshalerFunc(BucketGetResult{}, bucketGetResultMarshalerFunc)
human.RegisterMarshalerFunc(s3.ListBucketsOutput{}.Buckets, bucketMarshalerFunc)

return core.NewCommands(
objectRoot(),
objectConfig(),
objectBucket(),
bucketCreateCommand(),
bucketDeleteCommand(),
bucketGetCommand(),
bucketListCommand(),
bucketUpdateCommand(),
configGetCommand(),
configInstallCommand(),
)
cmds := core.NewCommands()

if cmdObjectRoot := objectRoot(); cmdObjectRoot != nil {
cmds.Add(cmdObjectRoot)
}
if cmdObjectConfig := objectConfig(); cmdObjectConfig != nil {
cmds.Add(cmdObjectConfig)
}
if cmdObjectBucket := objectBucket(); cmdObjectBucket != nil {
cmds.Add(cmdObjectBucket)
}
if cmdBucketCreate := bucketCreateCommand(); cmdBucketCreate != nil {
cmds.Add(cmdBucketCreate)
}
if cmdBucketDelete := bucketDeleteCommand(); cmdBucketDelete != nil {
cmds.Add(cmdBucketDelete)
}
if cmdBucketGet := bucketGetCommand(); cmdBucketGet != nil {
cmds.Add(cmdBucketGet)
}
if cmdBucketList := bucketListCommand(); cmdBucketList != nil {
cmds.Add(cmdBucketList)
}
if cmdBucketUpdate := bucketUpdateCommand(); cmdBucketUpdate != nil {
cmds.Add(cmdBucketUpdate)
}
if cmdConfigGet := configGetCommand(); cmdConfigGet != nil {
cmds.Add(cmdConfigGet)
}
if cmdConfigInstall := configInstallCommand(); cmdConfigInstall != nil {
cmds.Add(cmdConfigInstall)
}

return cmds
}

func objectRoot() *core.Command {

Check failure on line 51 in internal/namespaces/object/v1/custom.go

View workflow job for this annotation

GitHub Actions / build-and-test (1.22.x, ubuntu-latest)

other declaration of objectRoot
Expand Down
2 changes: 2 additions & 0 deletions internal/namespaces/object/v1/custom_bucket.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build darwin || linux || windows

package object

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/namespaces/object/v1/custom_config_get.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build darwin || linux || windows

package object

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/namespaces/object/v1/custom_config_install.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build darwin || linux || windows

package object

import (
Expand Down

0 comments on commit 13fcdb2

Please sign in to comment.