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
Add an ignored files config to prevent freezing from overwriting/removing files #25
Conversation
Related to, maybe duplicate of #23. |
Yep, this looks like a duplicate to me as well. The two solutions are slightly different though. Jim uses The difference is very subtle but has some implications to the user. I feel that Jim's solution puts more of a cognitive burden on the part of the user since they are responsible for either constructing full file paths or properly adding wildcards where needed. You can see this in the example Jim put in his docs for ignoring the hidden FREEZER_IGNORED_FILES = ['*/'+FREEZER_DESTINATION+'/*.git*','*/.git/*'] My solution makes the assumption that anything in the FREEZER_IGNORED_FILES = ['.git'] Both solutions work and solve the same problem and both have their pros and cons, so it just depends on where you stand as to which solution better fits the Frozen-Flask code base. |
Can we please get this merged? If not I'm going to have to fork this out and embed it into a script that I'm writing. |
Thanks for contributing, and sorry I let this get delayed. I just pushed something based on both this and #23. Let me know if this works for you, I’ll make a release. |
Released in 0.10. Please open new issues if the feature or anything is buggy. |
+1. Awesome. |
@SimonSapin the changes you committed look good to me. Funny enough, you went the route I originally started out with (i.e., adding an ignore parameter to |
As probably a side discussion (idk if there is one for this library)... it seems like I still might want to fork this out and embed it into funnel... I see I need to retain the copyright notice.. for clarity can I stick that notice into the source file that I'm going to fork from this? |
@shuhaowu the intent of using a BSD license is certainly to allow you to use or fork Frozen-Flask in any way you want. Moving the copyright notice to file headers is fine. That said, I would prefer if you submit improvements for inclusion rather than maintain your own fork. Is there still something missing that you’d need? |
No the library is good as is. I have a couple of very specific changes that will be no use to the upstream library in mind that I want to try out. Obviously if I did anything useful, I'll send off a PR to upstream (here). |
I am using Frozen-Flask to create my blog which I publish through Github Pages. The problem is that freezing removes all of the files in the
.git
directory of the blog's github repo which kills the repository. I could build to a different destination and then copy over all of the files to my github repo, but that is a tedious and error prone process. Instead, it would be nice to have a config setting that would allow you to specify files and directories to ignore during the freezing process (something akin to the .gitignore file).The changes I've made in this pull request introduce a new config setting
FREEZER_IGNORED_FILES
to fix this issue. The ignored files setting takes a list of file and directory names (relative to the destination directory) and expands those into a list of ignored file paths.So, for example, if you wanted to ignore all files within the
.git
directory of a Git repo and aCNAME
file within the top level of the destination directory, you could add the following to your script: