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