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:
parent
bae042b031
commit
f32928189d
1 changed files with 6 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue