pacote
pacote copied to clipboard
feat(extract): add 'safe mode' via extractOverwrite option
More or less a WIP, first round without tests. I've never worked with Promises IRL before, my only Promise experience is via API clients on the front-end and my node experience is limited, so I want to know what I did wrong here before digging into tests.
Adds the 'safe mode' outlined in #73, requiring a config option extractOverwrite
to overwrite an existing directory, otherwise aborting the extract operation
@zkat
oops my VSCode settings overrode your style settings, changing some of that back
I added some commentary since you mentioned you hadn't played with Promises before. Hopefully it helps :)
Oh and also thank you! This is looking great so far 🙆
@zkat commentary greatly appreciated :) review fixes and tests coming soon!
Hey! Sorry, I missed your last update!
This is looking great so far. The last thing I'd like to ask is whether you'd be willing/able to write a test for this: just a test that calls extract
on an empty directory, a missing directory, and a directory with stuff in it.
If this seems like too much, that's fine -- I've been slacking a lot on tests myself.
And don't worry about the conflict! I can resolve that for you 👌
@zkat can we merge this someday? I was looking for an ability to do this today.
whoa. totally forgot i had this PR open. let me take a look today or tomorrow and clean this up a bit. On Tue, Feb 26, 2019 at 07:14 William Bernting [email protected] wrote:
@zkat https://github.com/zkat can we merge this someday? I was looking for an ability to do this today.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zkat/pacote/pull/82#issuecomment-467415726, or mute the thread https://github.com/notifications/unsubscribe-auth/AB0keyIYm4TDVgt09KfIE7QEEUsrJSAoks5vRSUxgaJpZM4NMXpD .
If we want to make sure not to break anything, I think the safe mode should be opt in.