mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
fix(cursor): verify Cursor installation on Linux before auto-import
On Linux, verify that Cursor IDE is actually installed before importing tokens. Previously, leftover config files from a removed Cursor installation would trigger a false positive, creating a phantom Cursor provider connection. The check uses `which cursor` and falls back to checking for a .desktop file in ~/.local/share/applications/ Fixes #313 Co-authored-by: Ibrahim Ryan <ryan@nuevanext.com> Made-with: Cursor
This commit is contained in:
@@ -156,6 +156,27 @@ export async function GET() {
|
||||
});
|
||||
}
|
||||
|
||||
// On Linux, verify Cursor is actually installed (not just leftover config)
|
||||
if (platform === "linux") {
|
||||
let cursorInstalled = false;
|
||||
try {
|
||||
await execFileAsync("which", ["cursor"], { timeout: 5000 });
|
||||
cursorInstalled = true;
|
||||
} catch {
|
||||
try {
|
||||
const desktopFile = join(homedir(), ".local/share/applications/cursor.desktop");
|
||||
await access(desktopFile, constants.R_OK);
|
||||
cursorInstalled = true;
|
||||
} catch { /* not found */ }
|
||||
}
|
||||
if (!cursorInstalled) {
|
||||
return NextResponse.json({
|
||||
found: false,
|
||||
error: "Cursor config files found but Cursor IDE does not appear to be installed. Skipping auto-import.",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Strategy 1: sqlite3 CLI
|
||||
try {
|
||||
const tokens = await extractTokensViaCLI(dbPath);
|
||||
|
||||
Reference in New Issue
Block a user