Skip to content

Improve init command: create directory if missing and normalize path#857

Open
iron-prog wants to merge 1 commit intoMemPalace:developfrom
iron-prog:fix-init-directory-creation
Open

Improve init command: create directory if missing and normalize path#857
iron-prog wants to merge 1 commit intoMemPalace:developfrom
iron-prog:fix-init-directory-creation

Conversation

@iron-prog
Copy link
Copy Markdown

What does this PR do?

This PR improves the mempalace init

command by making it more user-friendly and robust.

How to test

• Automatically creates the target directory if it does not exist
• Normalizes the provided path using Path.resolve() to ensure consistency across the application

Previously, the command assumed the directory already existed, which could lead to errors or confusion during initial setup.

Checklist

  • Tests pass (python -m pytest tests/ -v)
  • No hardcoded paths
  • Linter passes (ruff check .)

This issue was encountered during local setup, where init failed if the directory didn’t exist. This change aligns the behavior with common CLI tools and improves the developer experience.

@iron-prog
Copy link
Copy Markdown
Author

Happy to adjust the approach if there's a preferred pattern for handling directory creation here.

@iron-prog
Copy link
Copy Markdown
Author

any update on this !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli CLI commands enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants