max-mapper / max-mapper/extract-zip
Cannot overwrite existing directory if symlink present (OSX)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 398
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
Let's say I have x.zip with contains a symlink and I unzip the first time to /foo.
If I try to unzip the same zip (or another zip containing the same symlink) to /foo it will fail with EEXIST. Regular files overwrite as expected (ie fs.writestream by default will overwrite). Unfortunately fs.symlink fails if the symlink already exists.
I can make a PR but do you have any suggestions on how to proceed?
I was thinking we check if the symlink already exists and delete before creating the new symlink.
Furthermore - should overwrite be set by flag (for the regular files as well)?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the extraction path that calls fs.symlink and compare it with the fs.writestream overwrite behavior described in the issue. Clarify whether existing symlinks should be replaced and whether overwrite belongs behind a flag; done means repeated extraction no longer fails with EEXIST and the chosen behavior is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100