diff options
| author | ishaan <contact@ishaan.cc> | 2026-07-19 13:09:56 +0530 |
|---|---|---|
| committer | ishaan <contact@ishaan.cc> | 2026-07-19 13:09:56 +0530 |
| commit | 8a5de371fccb89635bc1a624d8b1aca52aa18da4 (patch) | |
| tree | 89f3b2bec4e2425823534d4db46e3aecc2a15d91 /cmd/eno/cobra_ssh.go | |
| parent | 80b1c6deec723095f08de6aee289d4fb32ca9337 (diff) | |
better config (package)
Diffstat (limited to 'cmd/eno/cobra_ssh.go')
| -rw-r--r-- | cmd/eno/cobra_ssh.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/eno/cobra_ssh.go b/cmd/eno/cobra_ssh.go index 084960a..f219cfb 100644 --- a/cmd/eno/cobra_ssh.go +++ b/cmd/eno/cobra_ssh.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/spf13/cobra" + "gitlab.com/whiteboardguy/eno/internal/config" "gitlab.com/whiteboardguy/eno/internal/crypt" "gitlab.com/whiteboardguy/eno/internal/utils" "golang.org/x/crypto/ssh" @@ -38,7 +39,7 @@ var sshInitCmd = &cobra.Command{ Short: "setup ssh for Eno notes", Args: cobra.ExactArgs(0), Run: func(cmd *cobra.Command, args []string) { - if Conf.SSHInitialized { + if config.Conf.SSHInitialized { cmd.PrintErrln("SSH is already initialized") ok, err := utils.AskUserYesNo("Reinitialize SSH?", false) if err != nil { @@ -150,17 +151,17 @@ var sshInitCmd = &cobra.Command{ os.Exit(1) } - if err := updateConfig("DefaultSSHPrivPath", privateKeyPath); err != nil { + if err := config.Update("DefaultSSHPrivPath", privateKeyPath); err != nil { clear(privKeyBytes) cmd.PrintErrln(err) os.Exit(1) } - if err := updateConfig("DefaultSSHPubPath", publicKeyPath); err != nil { + if err := config.Update("DefaultSSHPubPath", publicKeyPath); err != nil { clear(privKeyBytes) cmd.PrintErrln(err) os.Exit(1) } - if err := updateConfig("SSHInitialized", true); err != nil { + if err := config.Update("SSHInitialized", true); err != nil { clear(privKeyBytes) cmd.PrintErrln(err) os.Exit(1) |