-
Notifications
You must be signed in to change notification settings - Fork 209
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
Shouldn't retype build
empty the target?
#94
Comments
Maybe a And this is something we all thought about while developing retype... I believe at some point we really had it... But the thought of having Retype accidentally wipe somebody's precious files before they could backup, should they e.g. be learning Retype and point it somewhere dangerous kept us from implementing this step by default. Besides, left residue shouldn't affect the actual output. There will be "dangling" files, but they won't affect how a retype deploy works. So it simply looked the safest bet. So personally, I wouldn't vow for "wipe-by-default". But having an explicit command to do so should be better for all cases. I mean, this would work great and safe for somebody learning retype, and the separate command would make the experienced have an easier time refresh the output. This |
One of the options we were considering is to persist paths of all files written by Retype to the |
Hmm. I am not a fan of this option. And no offense to Microsoft, but I wouldn't take their command line standards as an indication to anything. On that note, for instance, it is highly unorthodox to send a I see no point in If I remember correctly, mdbook is working like this.
I can understand that. So, the only thing that solves all concerns on the subject so far is: # These are safe to run - never removes anything
$ retype build
$ retype watch
# These reset the folder prior to building
$ retype build --reset
$ retype watch --reset
While this is a nice, and responsible idea, I believe this is equivalent to the Americans inventing an expensive pen that writes in space, and the Russians take a pencil... :) - if there is a simple solution, no need to add another thing in the system that can break. Then you end up with To me, simplicity is at the top of my list of things to consider before developing anything. |
We've gone back and forth on various options over time. Ultimately, we (mostly I) do not want Retype to be responsible for deleting ANYTHING, unless we know with absolute 100% certainty that Retype originally created that file. The big scary scenario is someone accidentally configuring the A quick look at the mdBook docs and I see they have a separate Obviously, it would be trivial for us to add a similar This self-cleaning feature is actually directly related to another huge new feature we are working on right now; an incremental build page dependency graph. The dependency graph refines the process of rebuilding only those pages that have been updated as well as rebuilding any dependent pages of those pages. For instance, when The new dependency graph is working and it's amazing and I'm anticipating that we will use the same tech to track generated files to allow for safe deletion. BTW, if you are using the Retype GitHub Action, the entire contents of the output are removed and regenerated with each run of the workflow, so you will never have dangler files. The danglers would only happen locally when you're developing (at least for now). Hope this helps. |
Just thought of an idea, maybe we could add some meta data to each file Retype writes to the A hash of the file might work well here. Interesting... |
You mean as part of the target file's source? Or as a separate single file that contains a list of all files, like mentioned by @AndreyChechel ? |
|
Nice. Thanks for the confirmation. I have added the topic to discuss during our Monday team meeting. We will try and come up with a solution for Retype. |
With all the times you and the team spent replying to me, I feel like I should be in that meeting... :) |
We have decided that Retype will delete files within the |
As I see it, the target folder is only under the responsibility of Retype. Meaning, users should never place anything manually inside it.
If this is indeed the case, I see no reason why the
retype build
command shouldn't erase the contents of the folder prior to rebuilding.During development, I change my mind about file names and locations, and just running
retype build
leaves me with the old names as well. I ended up always doing:If my assumption is incorrect, then perhaps a flag?
retype build --reset
?I would prefer it being the default (and only) behavior, but can understand arguments against it.
The text was updated successfully, but these errors were encountered: