Open cyberwombat opened 9 years ago
This is a very serious issue, on a few fronts. Thank you for sharing.
To prevent accidental usage:
beautify directory
as this is recursive and can cause damage when applied to too many files, as mentioned aboveFix issue that files become completely blank. This seems to occur when a massive number of files are beautified with beautify directory
. Unfortunately, when beautifying, there is no way to stop the beautification process and can lock up Atom and also result in the files being blank
N
(let's say 1000 files) at once, and instead do X
(10?) in parallel and sequentially work through them, so long as it's not stoppedI apologize for any inconvenience this may have caused. Thank goodness for version controlling projects. This is top priority issue.
I would also add a setting to turn off the sidebar menu entry. I went and just edited the cson file. My need to beautify an entire project/directory is zero and that menu entry is the top one for me - I prefer to just do it on a file by file basis.
Thanks for you prompt attention!
I would also add a setting to turn off the sidebar menu entry
I am not sure how I would go about this programmatically. Does Atom have an API for me to disable menu entries after the fact (loaded from the .cson file)?
Please change name "Beautify Directory" to "Delete all your file" :-1: Another victim of the stupid name. Sad...
@sunglee Wow bummer.. I feel you. Not sure if it's of any use for you but when I tried to find if any of my files has somehow been cached/saved the only potential one (which did not work for me sadly) was that if you are on a mac with time machine on (even if your drive is not plugged in) and there is at least 20% free space, that time machine will do a local save every hour. Unfortunately my disk did not have enough room so I lost everything since last commit.
I am going to publish with Beautify Directory
disabled until this is resolved. As much as it works when I use it, it does cause problems when you are beautifying too many files and other cases.
Published to v0.21.5
Please update immediately to ensure this issue does not cause problems for you again until it is resolved.
I would also like to implement
@Glavin001 isn't there a way to modify things so that it does one file at the time instead of what I am assuming is to load a billion files in memory?
Here's the applicable code for beautifying a directory: https://github.com/Glavin001/atom-beautify/blob/master/lib/beautify.coffee#L190-L211
Changing async.each
instead to async.eachSeries
would do what you suggest, @cyberwombat.
It would likely slow things down and not be maximizing usage of Node.js: high I/O operations and waiting for each file sequentially, instead of what is currently done now which is processing another file while another slow beautification is in progress.
Perhaps a balance - I have not used this myself but mapLimit or some other tool might be of use
I absolutely agree. Either mapLimit or probably eachLimit. And have the limit be able to be configured by users too. Good thinking
— Sent from Mailbox
On Wed, Mar 11, 2015 at 1:36 PM, Yashua notifications@github.com wrote:
Perhaps a balance - I have not used this myself but mapLimit or some other tool might be of use
Reply to this email directly or view it on GitHub: https://github.com/Glavin001/atom-beautify/issues/213#issuecomment-78301244
So recently the command has appeared "beautify directory" - where it used to just say "seach directory". I accidently hit it while searching in my project and it locked up and erased every. single. file. 1000's of files, the entire project completely blank. Im gonna go get drunk now. I dont have anything else to go on except there is a serious serious issue here.