mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
feat(platform): add cross-platform editor utilities and refresh functionality
- Add libs/platform/src/editor.ts with cross-platform editor detection and launching - Handles Windows .cmd batch scripts (cursor.cmd, code.cmd, etc.) - Supports macOS app bundles in /Applications and ~/Applications - Includes caching with 5-minute TTL for performance - Refactor open-in-editor.ts to use @automaker/platform utilities - Add POST /api/worktree/refresh-editors endpoint to clear cache - Add refresh button to Settings > Account for IDE selection - Update useAvailableEditors hook with refresh() and isRefreshing Fixes Windows issue where "Open in Editor" was falling back to Explorer because execFile cannot run .cmd scripts without shell:true. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1697,6 +1697,19 @@ function createMockWorktreeAPI(): WorktreeAPI {
|
||||
},
|
||||
};
|
||||
},
|
||||
refreshEditors: async () => {
|
||||
console.log('[Mock] Refreshing available editors');
|
||||
return {
|
||||
success: true,
|
||||
result: {
|
||||
editors: [
|
||||
{ name: 'VS Code', command: 'code' },
|
||||
{ name: 'Finder', command: 'open' },
|
||||
],
|
||||
message: 'Found 2 available editors',
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
initGit: async (projectPath: string) => {
|
||||
console.log('[Mock] Initializing git:', projectPath);
|
||||
|
||||
Reference in New Issue
Block a user