crrri icon indicating copy to clipboard operation
crrri copied to clipboard

Purge crrrri cache

Open ColinFay opened this issue 5 years ago • 1 comments

Screenshot 2020-05-01 at 11 06 02

I don't think there is any way to purge this cache from the package?

Would be nice to be able to do it without having to browse through your file system manually

ColinFay avatar May 01 '20 09:05 ColinFay

The content of this folder should be clean when chrome is closed. 🤔 But I can see some case where it may not be... on chrome crash for example.

Seems easy to add a function to help sanitize this. I see several option:

  • The Chrome object contains the information about the data chrome dir. We could expose this information maybe so that a user can easily find the currently used data dir.
  • We could offer a helper to open the global used data dir - basically rappdirs::user_data_dir(appname = "r-crrri") that we could also document better.
  • we could add a clean functions something like
crrri::clean_chr_data_dir(clean = getOption("crrri.clean_chr_data_dir", FALSE))

that would ask for confirmation unless the option is set to TRUE. It would delete all folder inside rappdirs::user_data_dir(appname = "r-crrri")

As we clean this folder by default at the end a chrome session, we could also just offer a cleaning function without any confirmation. That would be enough I think and easy to implement.

Is there a preference ?

cderv avatar May 01 '20 09:05 cderv