Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add template registry for handling template files #4

Merged
merged 1 commit into from
Dec 16, 2023

Conversation

travbale
Copy link
Contributor

This change creates a TemplateRegistry type for managing the collection of template objects and operations related to templates. The biggest change is related to using Go's embed package to embed all ignore templates into the compiled binary. This has the benefit of not needing to read from the file system or scrape the Go module cache for the templates directory.

  • Moved templates to internal/ignore/templates to allow for embedding it's contents in the ignore package.
  • Created ignore.TemplateRegistry with HasTemplate, List, and CopyTemplate operations.
  • Adjusted relevant commands to utilize ignore.TemplateRegistry.
  • Added test cases for ignore.TemplateRegistry.

@neptship neptship merged commit 3f38a0a into neptship:main Dec 16, 2023
3 checks passed
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.

2 participants