mirror of
https://github.com/int128/kubelogin.git
synced 2026-08-23 12:56:16 +00:00
* Run tests on macOS and Windows * Use filepath and client-go/util/homedir package
16 lines
243 B
Go
16 lines
243 B
Go
package cmd
|
|
|
|
import (
|
|
"path/filepath"
|
|
"strings"
|
|
|
|
"k8s.io/client-go/util/homedir"
|
|
)
|
|
|
|
func expandHomedir(s string) string {
|
|
if !strings.HasPrefix(s, "~") {
|
|
return s
|
|
}
|
|
return filepath.Join(homedir.HomeDir(), strings.TrimPrefix(s, "~"))
|
|
}
|