Check if user has shim
()
| 51 | |
| 52 | // Check if user has shim |
| 53 | func IsShimInPath() bool { |
| 54 | homeDir, _ := os.UserHomeDir() |
| 55 | shimDir := filepath.Join(homeDir, ".govm", "shim") |
| 56 | currentPath := os.Getenv("PATH") |
| 57 | pathSeparator := string(os.PathListSeparator) |
| 58 | pathEntries := strings.Split(currentPath, pathSeparator) |
| 59 | for _, entry := range pathEntries { |
| 60 | if entry == shimDir { |
| 61 | return true |
| 62 | } |
| 63 | } |
| 64 | return false |
| 65 | } |
| 66 | func GetShimPathInstructions() string { |
| 67 | if runtime.GOOS == "windows" { |
| 68 | return "Add to PATH: %USERPROFILE%\\.govm\\shim" |
no outgoing calls
no test coverage detected