Skip to content

Conversation

@q-inho
Copy link
Member

@q-inho q-inho commented Jul 24, 2025

Resolve #57

Fix

  • The create_new_file function now creates a mirrored documentation file whenever a new .hat source file is created inside a project. The docs file is placed under src/hat_docs/ with the same relative path as the source file and a .md extension.
  • Before creating a file, te tool now checkts that the target path resides within the current project's directory. If the resolved file path is outside the project, the operation is aborted with an error.
  • CLI ensures the users run hat new -f from within an existing project. If not, it reports a n error adn stops.
  • If the providedf ile path does not start wit hsrc/, it is automatically prefixed with src/ so that new files are placed in the correc tproject subdirectory.
  • The .hat extension is appended if it's missing from the given filename, ensuring connsistency.
  • If either the target source file or its documentation file already, it fail with an error isntead of overwriting them.

@q-inho q-inho self-assigned this Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix create new file on toolchain project

2 participants