diff options
Diffstat (limited to 'internal/cli/workers/command.go')
-rw-r--r-- | internal/cli/workers/command.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/cli/workers/command.go b/internal/cli/workers/command.go index e3f8f7e3..f498b7af 100644 --- a/internal/cli/workers/command.go +++ b/internal/cli/workers/command.go @@ -13,14 +13,13 @@ import ( tm "github.com/buger/goterm" "github.com/fatih/color" - "github.com/roadrunner-server/config/v2" "github.com/roadrunner-server/errors" "github.com/roadrunner-server/informer/v2" "github.com/spf13/cobra" ) // NewCommand creates `workers` command. -func NewCommand(cfgPlugin *config.Plugin) *cobra.Command { //nolint:funlen +func NewCommand(cfgFile *string) *cobra.Command { //nolint:funlen var ( // interactive workers updates interactive bool @@ -35,7 +34,11 @@ func NewCommand(cfgPlugin *config.Plugin) *cobra.Command { //nolint:funlen informerList = "informer.List" ) - client, err := internalRpc.NewClient(cfgPlugin) + if cfgFile == nil { + return errors.E(op, errors.Str("no configuration file provided")) + } + + client, err := internalRpc.NewClient(*cfgFile) if err != nil { return err } |