INNER CODE UNIT · Go

setAdHocSSH

umputun/spot · cmd/spot/main.go:534

func setAdHocSSH(opts options, pbook *config.PlayBook) (*config.PlayBook, error) {
	if opts.SSHUser == "" {
		u, err := userProvider.Current()
		if err != nil {
			return nil, fmt.Errorf("can't get current user: %w", err)
		}
		pbook.User = u.Username
	}
	if opts.SSHKey == "" {
		u, err := userProvider.Current()
		if err != nil {
			return nil, fmt.Errorf("can't get current user: %w", err)
		}
		pbook.SSHKey = filepath.Join(u.HomeDir, ".ssh", "id_rsa")
	}
	return pbook, nil
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…