Skip to content

Commit 6fbdefd

Browse files
joohwcursoragent
andcommitted
fix(desktop): gate darwin X_OK check behind build tag
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent bb35bbf commit 6fbdefd

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

core/internal/buildinfo/buildinfo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "strings"
44

55
// Set at link time via -ldflags (see .goreleaser.yaml).
66
var (
7-
Version = "dev0.1.58"
7+
Version = "dev0.1.59"
88
Commit = "none"
99
Date = "unknown"
1010
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//go:build darwin
2+
3+
package desktop
4+
5+
import "syscall"
6+
7+
func isExecutableFile(path string) bool {
8+
return syscall.Access(path, syscall.X_OK) == nil
9+
}

core/internal/desktop/agents_executable_unix.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
//go:build !windows
1+
//go:build !windows && !darwin
22

33
package desktop
44

5-
import (
6-
"os"
7-
"runtime"
8-
"syscall"
9-
)
5+
import "os"
106

117
func isExecutableFile(path string) bool {
12-
if runtime.GOOS == "darwin" {
13-
return syscall.Access(path, syscall.X_OK) == nil
14-
}
158
info, err := os.Stat(path)
169
if err != nil || info.IsDir() {
1710
return false

0 commit comments

Comments
 (0)