checkInitialization checks if fssh is already initialized
(force bool)
| 103 | |
| 104 | // checkInitialization checks if fssh is already initialized |
| 105 | func checkInitialization(force bool) error { |
| 106 | exists, err := keychain.MasterKeyExists() |
| 107 | if err != nil { |
| 108 | return fmt.Errorf("failed to check initialization status: %w", err) |
| 109 | } |
| 110 | |
| 111 | if exists && !force { |
| 112 | fmt.Println("⚠️ fssh is already initialized!") |
| 113 | fmt.Println() |
| 114 | if !otp.PromptConfirm("Do you want to reinitialize? This will require re-importing all keys") { |
| 115 | fmt.Println("Setup cancelled.") |
| 116 | os.Exit(0) |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | return nil |
| 121 | } |
| 122 | |
| 123 | // promptAuthMode prompts the user to select authentication mode |
| 124 | func promptAuthMode() (string, error) { |
no test coverage detected