Skip to content

Commit

Permalink
fix(cmd) check if workspace exists before running dump or reset
Browse files Browse the repository at this point in the history
From #167
  • Loading branch information
cwurm committed Jun 8, 2020
1 parent 5baedb5 commit 358248c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ configure Kong.`,
// or Kong Enterprise single workspace
if dumpWorkspace != "" {
config.Workspace = dumpWorkspace

if err := checkWorkspace(config); err != nil {
return err
}

client, err = utils.GetKongClient(config)
if err != nil {
return err
Expand Down
6 changes: 6 additions & 0 deletions cmd/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ By default, this command will ask for a confirmation prompt.`,
}
}
if resetWorkspace != "" {
config.Workspace = resetWorkspace

if err := checkWorkspace(config); err != nil {
return err
}

workspaces = append(workspaces, resetWorkspace)
}

Expand Down

0 comments on commit 358248c

Please sign in to comment.