feat: add identity_file field to config connections config

This commit is contained in:
Connor Edwards
2025-02-08 15:56:18 +00:00
parent e3a310397b
commit ac48b8bee6
5 changed files with 57 additions and 11 deletions
+13
View File
@@ -5,8 +5,21 @@ import (
"os"
"os/user"
"strconv"
"strings"
)
func ExpandHomeDir(path string) string {
if len(path) == 0 {
return path
}
if path[0] == '~' {
// TODO: Improve compat with other OSes
path = strings.Replace(path, "~", "${HOME}", 1)
return os.ExpandEnv(path)
}
return path
}
// LookupUIDGID returns the user and group IDs for the given username.
func LookupUIDGID(username string) (uid, gid int, err error) {
usr, err := user.Lookup(username)