aboutsummaryrefslogtreecommitdiff
path: root/cli_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-05-19 22:31:56 +0700
committerShulhan <ms@kilabit.info>2023-05-19 22:31:56 +0700
commita31b534b36eda669bab99819e4b45fa343ff38d9 (patch)
treeda14195f9625565adf362484c5740bded25ffe6f /cli_test.go
parentdded88bf1546f30185e2fc30c11e4f1322abd213 (diff)
downloadgotp-a31b534b36eda669bab99819e4b45fa343ff38d9.tar.xz
all: load private key only when needed
In case the configuration use private key with passphrase, the bash completion will hang due to the command ask for passphrase. This changes fix this issue by loading private key only when doing add, generate, import, or remote-private-key.
Diffstat (limited to 'cli_test.go')
-rw-r--r--cli_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli_test.go b/cli_test.go
index 70a5e1d..81253b1 100644
--- a/cli_test.go
+++ b/cli_test.go
@@ -191,6 +191,11 @@ func TestCli_SetPrivateKey(t *testing.T) {
}
cli.cfg = cfg
+ cli.cfg.privateKey, err = loadPrivateKey(cli.cfg.PrivateKey, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+
var (
gotLabels []string = cli.List()
label string