diff options
author | Michael Muré <batolettre@gmail.com> | 2019-11-10 14:46:55 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-11-10 14:53:40 +0100 |
commit | e2445edcb99ed0aa7fcd40fe7484d71e73367334 (patch) | |
tree | f5f38c8d6d6f426631fda7feaddef34332b6040c /commands/bridge_token_rm.go | |
parent | 45653bd31d9ec91123ee42803cd5c46b43d18528 (diff) | |
download | git-bug-e2445edcb99ed0aa7fcd40fe7484d71e73367334.tar.gz |
bridge: various improvement on the global token PR
Diffstat (limited to 'commands/bridge_token_rm.go')
-rw-r--r-- | commands/bridge_token_rm.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/commands/bridge_token_rm.go b/commands/bridge_token_rm.go index 7296f95a..1f4ca4e8 100644 --- a/commands/bridge_token_rm.go +++ b/commands/bridge_token_rm.go @@ -1,13 +1,26 @@ package commands import ( + "fmt" + "github.com/spf13/cobra" "github.com/MichaelMure/git-bug/bridge/core" ) func runBridgeTokenRm(cmd *cobra.Command, args []string) error { - return core.RemoveToken(repo, args[0]) + token, err := core.LoadTokenPrefix(repo, args[0]) + if err != nil { + return err + } + + err = core.RemoveToken(repo, token.ID()) + if err != nil { + return err + } + + fmt.Printf("token %s removed\n", token.ID()) + return nil } var bridgeTokenRmCmd = &cobra.Command{ |