Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit a8106cf

Browse files
committed
Directly check if repo exists
This avoids an annoying error at the end if the repo does not exist.
1 parent bdc68ca commit a8106cf

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internals/secrethub/service_gcp_init.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ func (cmd *ServiceGCPInitCommand) Run() error {
4848
return err
4949
}
5050

51+
_, err = client.Repos().Get(cmd.repo.String())
52+
if err != nil {
53+
return err
54+
}
55+
5156
if cmd.serviceAccountEmail == "" && cmd.kmsKeyResourceID == "" {
5257
fmt.Fprintln(cmd.io.Stdout(), "This command creates a new service account for use on GCP. For help on this, run `secrethub service gcp init --help`.")
5358

0 commit comments

Comments
 (0)