mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-10 13:03:41 +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
|
||
|
}
|