Skip to content
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

Don't nuke directory specified in out.dir #86

Closed
man-shar opened this issue Apr 1, 2023 · 4 comments
Closed

Don't nuke directory specified in out.dir #86

man-shar opened this issue Apr 1, 2023 · 4 comments

Comments

@man-shar
Copy link

man-shar commented Apr 1, 2023

Just for a quickly trying out out.dir, I put in a directory I was using and thought it would just create a few files I can later delete.

Unfortunately ended up losing a few files :P

Might be better just adding to the folder rather than nuking it?

@tdhock
Copy link
Collaborator

tdhock commented Apr 3, 2023

Sorry to hear that you lost some files, but this behavior is documented in ?animint2dir, so I don't think that any change is warranted at this time,

\item{out.dir}{directory to store html/js/csv files. If it exists
already, it will be removed before writing the new
directory/files.}

@tdhock tdhock closed this as completed Apr 3, 2023
@tdhock
Copy link
Collaborator

tdhock commented Apr 3, 2023

At some point in the past we did do that (adding to the folder rather than nuking it) but it resulted in some difficult issues when debugging, so that is how we landed on the current approach. Is there some other place where you think we could mention this behavior?

On https://rcdata.nau.edu/genomic-ml/animint2-manual/Ch05-sharing.html is says:
If the parent of out.dir does not exist, that is an error (you can use dir.create to create the parent if necessary). If out.dir does not exist, then it will be created. If out.dir does exist, then any files in that directory will be overwritten.

@man-shar
Copy link
Author

man-shar commented Apr 4, 2023

Hmmm, I understand. That documentation seems appropriate to me.

In my own experience with dev servers, there seems to be a variation in how they handle it. parcel doesn't empty the folder, while vite chooses to empty it by default, unless emptyOutDir config option is set to false.

Parcel's creator mentions my particular use case where the build and work directory could be the same in this reply.

This might just boil down to personal taste then I suppose. What I feel would be safer is:

  1. If out.dir isn't specified, do the usual temp directory creation.
  2. If out.dir is specified, create an animint-dist/ or animint-build folder inside out.dir, and use that to run the server.

Either decision is fine with me tbh – I don't have much experience with R libraries.

@tdhock
Copy link
Collaborator

tdhock commented Dec 18, 2023

fixed via an error message #88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants