MCPcopy Create free account
hub / github.com/Melkeydev/govm / IsShimInPath

Function IsShimInPath

internal/utils/utils.go:53–65  ·  view source on GitHub ↗

Check if user has shim

()

Source from the content-addressed store, hash-verified

51
52// Check if user has shim
53func 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}
66func GetShimPathInstructions() string {
67 if runtime.GOOS == "windows" {
68 return "Add to PATH: %USERPROFILE%\\.govm\\shim"

Callers 3

ViewMethod · 0.92
UseVersionFunction · 0.92
SwitchVersionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected