From da6591e4807d6aec5f230e8a1efad1e2ef686608 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Tue, 10 Dec 2019 20:13:49 +0100 Subject: cmd: "user create" only assign the user identity if not set --- commands/user_create.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/user_create.go b/commands/user_create.go index 88cc94de..15b9767e 100644 --- a/commands/user_create.go +++ b/commands/user_create.go @@ -53,11 +53,18 @@ func runUserCreate(cmd *cobra.Command, args []string) error { return err } - err = backend.SetUserIdentity(id) + set, err := backend.IsUserIdentitySet() if err != nil { return err } + if !set { + err = backend.SetUserIdentity(id) + if err != nil { + return err + } + } + _, _ = fmt.Fprintln(os.Stderr) fmt.Println(id.Id()) -- cgit