1
0
Fork 0
mirror of https://github.com/imjasonh/cnotes synced 2026-07-07 00:33:04 +00:00

Fix go run detection by checking for go-build in any cache location

- Add checks for /go-build/ and /Caches/go-build/ patterns
- Clean up settings.json again to remove go-build cache entry
This commit is contained in:
Jason Hall 2025-07-21 15:29:46 -04:00
parent bae042b031
commit f32928189d
Failed to extract signature

View file

@ -83,11 +83,15 @@ func runInstall(cmd *cobra.Command, args []string) error {
realTempDir = tempDir
}
// Check if executable is in temp directory
// Check if executable is in temp directory or is from go run
if strings.HasPrefix(realExecutable, tempDir) ||
strings.HasPrefix(executable, tempDir) ||
strings.HasPrefix(realExecutable, realTempDir) ||
strings.HasPrefix(executable, realTempDir) {
strings.HasPrefix(executable, realTempDir) ||
strings.Contains(executable, "/go-build/") ||
strings.Contains(realExecutable, "/go-build/") ||
strings.Contains(executable, "/Caches/go-build/") ||
strings.Contains(realExecutable, "/Caches/go-build/") {
return fmt.Errorf("cannot install from temporary directory: %s\nPlease build and install cnotes properly:\n go install && cnotes install", executable)
}
}