mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-27 20:36:29 -04:00
Remove overly-verbose ssh key input prompt
This commit is contained in:
+1
-1
@@ -56,7 +56,7 @@ func CopyShortcut(realPath string, field int) error {
|
||||
func ClearArgument() error {
|
||||
assignedContents := back.ReadFromStdin()
|
||||
if assignedContents == "" {
|
||||
os.Exit(0) // use os.Exit instead of core.Exit, as this function runs out of a background subprocess that is invisible to the user (will never appear in GUI/TUI environment)
|
||||
os.Exit(0) // use os.Exit directly since this function runs out of a background subprocess that is invisible to the user (will never appear in GUI/TUI environment)
|
||||
}
|
||||
return ClearProcess(assignedContents)
|
||||
}
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ func LibmuttonInit(inputCB func(prompt string) string, rcwPassword []byte, appen
|
||||
} else {
|
||||
// ensure ssh key file exists (and is a file)
|
||||
fallbackSSHKey := back.Home + global.PathSeparator + ".ssh" + global.PathSeparator + "id_ed25519"
|
||||
sshKeyPath := cmp.Or(back.ExpandPathWithHome(inputCB(back.AnsiBold+"Note:"+back.AnsiReset+" Only key-based authentication is supported (keys may optionally be password-protected).\n The remote server must already be in your ~"+global.PathSeparator+".ssh"+global.PathSeparator+"known_hosts file.\n\nSSH private identity file path (falls back to \""+fallbackSSHKey+"\"):")), fallbackSSHKey)
|
||||
sshKeyPath := cmp.Or(back.ExpandPathWithHome(inputCB("SSH private identity file path (falls back to \""+fallbackSSHKey+"\"):")), fallbackSSHKey)
|
||||
_, err := back.TargetIsFile(sshKeyPath, true)
|
||||
if err != nil {
|
||||
return errors.New("unable to find SSH identity file: " + err.Error())
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ var RetryPassword = true
|
||||
func RCWDArgument() {
|
||||
password := back.ReadFromStdin()
|
||||
if password == "" {
|
||||
os.Exit(0)
|
||||
os.Exit(0) // use os.Exit directly since this function is only intended for non-interactive CLI clients
|
||||
}
|
||||
daemon.Start([]byte(password))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user