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

Boilerplate management refactor #902

Merged
merged 9 commits into from
Jan 16, 2025
Merged

Boilerplate management refactor #902

merged 9 commits into from
Jan 16, 2025

Conversation

oscarlevin
Copy link
Member

We have been regenerating all boilerplate on every instance, and management of what files are generated is manual (the user must remove the magic comment).

With this PR:

  • Boilerplate resources are only checked on pretext update or pretext new or pretext init
  • The magic comments will still work, but the new files will contain a comment specifying which version of pretext was used to generate the file.
  • For files with the version used to generate them listed in the comment, the file will be compared to the hash of the stock file. If they are different, we will assume the file is no longer managed.
  • If a project is not a git repository, none of the git-specific boilerplate files will be generated or managed.

The PR also includes some refactoring of the entry main cli command. pretext upgrade no longer checks for a project, and pretext new runs without a warning that the default project.ptx is being used.

pretext/cli.py Outdated Show resolved Hide resolved
@oscarlevin oscarlevin merged commit 71b80be into main Jan 16, 2025
7 of 8 checks passed
@oscarlevin oscarlevin deleted the boilerplate branch January 16, 2025 19:22
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