mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +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
|
|||
}
|