-
Notifications
You must be signed in to change notification settings - Fork 300
/tmp never gets cleared out #8
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
Comments
what do you think about cleaning it up on startup and maybe a menu option to do exactly the same? Note: if implementing menu option, set all Ink files |
Hrm, I'd rather that the user didn't have to worry about it. I'm thinking about a flow like:
Probably what we need is an extra field in the Could probably just invalidate everything when the user does anything to do with file changes, to be robust. (i.e. effectively do a |
Actually, your future case of detecting file changes would also fix this I guess... maybe it's better to put the effort into file watching now. What do you think? I could have quick look at it 😄 I'll attack the problem in steps but it sounds like once file watching is setup, it's just setting the flags in the right file (and deleting if appropriate). A case that may require asking the user for information is if the currently opened file is deleted elsewhere. For example, Atom leaves the file open but marks it as unsaved (once you save it doesn't need to ask for the file name though). I need to work on a couple of other projects now but I'll try to come back to this later, is that ok with you? |
Sure, whenever you have time to spend on the project is absolutely fine with me! I think we need to remember that there's always a difference between:
File watching may help with (1), but the kind of deletion I'm talking about could be done entirely in (2) (i.e. On the subject of file watching/saving in general, yeah, we need to decide what our preferred behaviour is. Two interesting cases: Case 1 - saved changes
Case 2 - unsaved changes
|
Great points!! 👍 love the simple explanation. I guess Case 1 should behave like Case 2 (ask) if it's the file you're currently looking at. Being the only opened file is a special case of that I guess. What do you think? There are two steps one this: What this means is, I came full circle again and think I can ignore the watching for now. I should work on making sure Makes it easier to test and everything because I can directly change the InkFile and see what happens. This state sync should still happen in the current place, where it calls |
Yup, exactly - we only need to consider InkFile -> /tmp for now. Sounds good! (btw I removed a line you added that said "if there are no updated files, don't send the play message", since sometimes you want to re-play a story without any updated files) |
cool, I wasn't sure about that one either but forgot to mention, sorry. |
I have a related issue. I have a linux system with multiple users, and whoever starts Inky first owns the /tmp/inky_compile folder and the other users cannot use Inky until that folder is deleted and recreated with under their account. I think the ideal solution would be for Inky to respect the $TMPDIR env var ( it doesn't appear to) so I could set a per user tmp directory. But if the /tmp/ folder was cleaned up on exit, that would fix the problem too. Let me know if I should open a new issue. |
Hmmm, I can't remember the reasoning but on Windows we use node.js's inky/app/main-process/inklecate.js Lines 28 to 31 in 1ce5846
I'm not a Linux person but I'm happy to take a (thoroughly tested!) pull request to change the behaviour. |
#223 |
Heh, I just opened an issue for this: #369 |
Looking into this, this looks like a platform independent way of creating a temporary directory: https://www.geeksforgeeks.org/node-js-fs-mkdtemp-method/ - in particular, is |
If you remove a file in the project (e.g. in the finder), it still compiles when it shouldn't.
The text was updated successfully, but these errors were encountered: