This repository was archived by the owner on Feb 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 "crypto/sha256"
66 "encoding/base64"
77 "errors"
8+ "fmt"
89
910 "github.com/secrethub/secrethub-cli/internals/cli/ui"
1011 "github.com/secrethub/secrethub-cli/internals/secrethub/command"
@@ -70,18 +71,22 @@ func (cmd *InitCommand) Run() error {
7071 return err
7172 }
7273
73- _ , err = client .Secrets ().Write (secretpath .Join (repoPath , "username" ), []byte (username ))
74+ usernamePath := secretpath .Join (repoPath , "username" )
75+ _ , err = client .Secrets ().Write (usernamePath , []byte (username ))
7476 if err != nil {
7577 return err
7678 }
7779
7880 h := hmac .New (sha256 .New , []byte ("this-is-no-good-way-to-generate-a-password-that-is-why-we-only-use-it-for-demo-purposes" ))
7981 password := base64 .RawStdEncoding .EncodeToString (h .Sum ([]byte (username )))[:20 ]
8082
81- _ , err = client .Secrets ().Write (secretpath .Join (repoPath , "password" ), []byte (password ))
83+ passwordPath := secretpath .Join (repoPath , "password" )
84+ _ , err = client .Secrets ().Write (passwordPath , []byte (password ))
8285 if err != nil {
8386 return err
8487 }
8588
89+ fmt .Printf ("Created the following secrets:\n %s\n %s\n " , usernamePath , passwordPath )
90+
8691 return nil
8792}
You can’t perform that action at this time.
0 commit comments