Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Feb 6, 2025
1 parent b8b9ae6 commit 5ec68a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions connect/cmd/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
)

func RemoveHandler(ctx context.Context, cmd *plugin.ExecutedCommand) error {
if len(cmd.Args) < 1 {
return errors.New("usage: connect remove <chain>")
}

cfg, err := chains.ReadConfig()
if errors.Is(err, chains.ErrConfigNotFound) {
return nil
Expand All @@ -21,6 +25,9 @@ func RemoveHandler(ctx context.Context, cmd *plugin.ExecutedCommand) error {
}

chainName := cmd.Args[0]
if _, ok := cfg.Chains[chainName]; !ok {
return errors.New("chain not found")
}

// delete config
delete(cfg.Chains, chainName)
Expand Down

0 comments on commit 5ec68a3

Please sign in to comment.