MCPcopy Create free account
hub / github.com/Mister-leo/fssh / checkInitialization

Function checkInitialization

cmd/fssh/setup.go:105–121  ·  view source on GitHub ↗

checkInitialization checks if fssh is already initialized

(force bool)

Source from the content-addressed store, hash-verified

103
104// checkInitialization checks if fssh is already initialized
105func 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
124func promptAuthMode() (string, error) {

Callers 1

runInteractiveSetupFunction · 0.85

Calls 2

MasterKeyExistsFunction · 0.92
PromptConfirmFunction · 0.92

Tested by

no test coverage detected