Refactored the hosts file generation logic to improve its functionality and readability. Introduced a more robust file reading system that recursively reads all text files in a given directory, excluding ones starting with a period, ending with `.disabled`, or containing the `HOSTSD IGNORE` marker. This enhancement helps in accommodating a broader range of file organizations and simplifying the exclusion of specific files from the hosts file generation process. Additionally, updated the version to 0.1.1 to mark this incremental improvement.
- Improved file reading by handling nested directories and providing options to ignore certain files.
- Added capability to prefix file paths in the generated content, enhancing traceability of file origins.
- Streamlined error handling for non-text files and introduced informative skip messages for ignored files or binary content.
Introduced a comprehensive setup for `hostsd`, a simple hosts file manager, marking the project's inception. This entails crafting the PyPI CI/CD pipeline configuration, ensuring seamless publication processes on tag-based releases. Additionally, standard project necessities such as `.gitignore`, `LICENSE`, and `README.md` were put in place, alongside the core project configuration in `pyproject.toml`. The initial source code foundation is laid out in `src/hostsd`, featuring argument parsing and file management logic essential for hosts file manipulation.
The PyPI CI/CD configuration in `.forgejo/workflows/pypi.yml` facilitates automated publishing to PyPI upon tagging, backed by Docker to guarantee environment consistency. The project adopts a community-friendly stance with an MIT license, encouraging open collaboration. Documentation is immediately available via `README.md`, covering installation, usage, and automated update setups, ensuring users can effectively leverage `hostsd` from the get-go.
This setup underscores the project's commitment to enabling efficient hosts file management across various environments, laying the groundwork for future enhancements and community contributions.