From b7fef3877f1932a73b9d08fdbda550be0273f064 Mon Sep 17 00:00:00 2001 From: yetone Date: Mon, 5 Oct 2026 00:53:06 +0800 Subject: [PATCH] =?UTF-8?q?agent:=20Cursor=20Private=20Inference's=20progr?= =?UTF-8?q?am=20in=20a=20.app=20is=20named=20as=20on=20a=20Mac=20on=20any?= =?UTF-8?q?=20system,=20so=20TestCursorLocal=20passes=20on=20Linux=20CI=20?= =?UTF-8?q?=E2=80=94=20the=20.app=20fallback=20(no=20Info.plist)=20took=20?= =?UTF-8?q?product.json's=20applicationName=20as=20Linux=20names=20it=20(c?= =?UTF-8?q?ursor),=20while=20a=20.app=20is=20a=20Mac's=20bundle=20and=20it?= =?UTF-8?q?s=20program=20is=20Cursor.=20The=20test=20failed=20on=20the=20u?= =?UTF-8?q?buntu=20CI=20since=20v0.1.877=20and=20passes=20now=20in=20a=20l?= =?UTF-8?q?inux/arm64=20container=20(it=20failed=20there=20on=20the=20old?= =?UTF-8?q?=20code).=20go=20vet,=20builds=20(darwin,=20GOOS=3Dlinux=20nogu?= =?UTF-8?q?i,=20GOOS=3Dwindows)=20and=20go=20test=20-tags=20nogui=20-count?= =?UTF-8?q?=3D1=20./...=20under=20a=20temp=20HOME=20pass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/agent/cursorlocal.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/agent/cursorlocal.go b/internal/agent/cursorlocal.go index c670fc92..68412ee4 100644 --- a/internal/agent/cursorlocal.go +++ b/internal/agent/cursorlocal.go @@ -97,7 +97,7 @@ func findCursorLocal(roots []string) string { if exe := plistExecutable(filepath.Join(dir, "Contents", "Info.plist")); exe != "" { return filepath.Join(dir, "Contents", "MacOS", exe) } - return filepath.Join(dir, "Contents", "MacOS", p.exe()) + return filepath.Join(dir, "Contents", "MacOS", p.macExe()) } continue } @@ -130,6 +130,15 @@ func (p cursorProduct) exe() string { if runtime.GOOS == "linux" { return n } + return p.macExe() +} + +// macExe is the program's name in a .app, which is a Mac's on any system. +func (p cursorProduct) macExe() string { + n := p.ApplicationName + if n == "" { + return "Cursor" + } return strings.ToUpper(n[:1]) + n[1:] }