Currently, opening project markdown files requires navigating a duplicated directory structure ([project-name]/[projects]/[project-name]). This issue aims to implement a quick fix by integrating the jumpToDeepest function into the open.ts command. This will allow users to simply type grind open [project-name] and have the tool automatically resolve the correct path to the project files.
Acceptance Criteria:
- The
open command correctly resolves the project path using jumpToDeepest.
- The
open command opens the project markdown files as expected.
- Error handling is implemented to gracefully handle invalid project names or unresolved paths.
- Unit tests are added to verify the
jumpToDeepest function's behavior in this context.
Tasks:
- Create
src/utils/pathUtils.ts and paste in the provided TypeScript code.
- Create/modify
src/utils/process.ts and paste in the provided changeDirectory function.
- Modify
src/commands/open.ts to call jumpToDeepest before opening the files.
- Add error handling to
src/commands/open.ts to catch errors from jumpToDeepest or changeDirectory.
- Write unit tests for
jumpToDeepest within src/utils/pathUtils.ts.
- Test the
open command with various project names.
Currently, opening project markdown files requires navigating a duplicated directory structure (
[project-name]/[projects]/[project-name]). This issue aims to implement a quick fix by integrating thejumpToDeepestfunction into theopen.tscommand. This will allow users to simply typegrind open [project-name]and have the tool automatically resolve the correct path to the project files.Acceptance Criteria:
opencommand correctly resolves the project path usingjumpToDeepest.opencommand opens the project markdown files as expected.jumpToDeepestfunction's behavior in this context.Tasks:
src/utils/pathUtils.tsand paste in the provided TypeScript code.src/utils/process.tsand paste in the providedchangeDirectoryfunction.src/commands/open.tsto calljumpToDeepestbefore opening the files.src/commands/open.tsto catch errors fromjumpToDeepestorchangeDirectory.jumpToDeepestwithinsrc/utils/pathUtils.ts.opencommand with various project names.