mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
18 lines
232 B
Go
18 lines
232 B
Go
package helpers
|
|||
|
|||
import (
|
|||
"os"
|
|||
"strings"
|
|||
)
|
|||
|
|||
func PruneHome(pwd string) string {
|
|||
if strings.HasPrefix(pwd, "~") {
|
|||
userhome, err := os.UserHomeDir()
|
|||
if err != nil {
|
|||
panic(err)
|
|||
}
|
|||
pwd = userhome + pwd[1:]
|
|||
}
|
|||
return pwd
|
|||
}
|