popomore / projj

Manage repository easily.
MIT License
267 stars 39 forks source link

支持 warp #64

Open atian25 opened 4 months ago

atian25 commented 4 months ago

判断运行环境或者提供配置,在 warp/iterm2 执行添加完项目后,直接在当前终端切换到对应目录,而不是强制 iterm2

atian25 commented 4 months ago

✨✨ Here's an AI-assisted sketch of how you might approach this issue saved by @atian25 using Copilot Workspace v0.17

Topic
Does the terminal automatically switch to the corresponding directory after adding a project in warp/iterm2 environments?
Before
- Terminal does not automatically switch to the corresponding directory after adding a project in warp/iterm2 environments. - The terminal change directory feature is only supported on Darwin platforms as indicated in `lib/command/add.js` and `lib/command/find.js`. - The script for changing directories is generated specifically for iTerm and Terminal applications on macOS, as seen in `lib/utils.js`. - There is no mention or support for warp/iterm2 environments in the current implementation.
After
* Terminal now automatically switches to the corresponding directory after adding a project in warp/iterm2 environments. * Terminal change directory feature is extended to support warp/iterm2 environments alongside Darwin platforms. * Scripts for changing directories are updated to include support for warp/iterm2 environments in addition to iTerm and Terminal applications on macOS.
Plan
* `lib/utils.js` (CHANGE) - Add a new function `generateWarpScript` to generate a script for changing directories in warp/iterm2 environments. - Update `generateAppleScript` to include a condition that checks for warp/iterm2 environments and calls `generateWarpScript` if true. * `lib/command/add.js` (CHANGE) - Modify the `_run` method to include a check for warp/iterm2 environments and execute the corresponding script for directory change. * `lib/command/find.js` (CHANGE) - Modify the `_run` method to include a check for warp/iterm2 environments and execute the corresponding script for directory change.
Sketch of implementation
[View the changes](https://copilot-workspace.githubnext.com/popomore/projj/issues/64?shareId=e709664c-de44-4f5f-8b03-93f825cd0702)
Details
Code analyzed at b2ef85c491429ba16d876b0eb74295597f9ffd7d