pacote icon indicating copy to clipboard operation
pacote copied to clipboard

feat(extract): add 'safe mode' via extractOverwrite option

Open aem opened this issue 7 years ago • 8 comments

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

aem avatar Apr 29 '17 20:04 aem

oops my VSCode settings overrode your style settings, changing some of that back

aem avatar Apr 29 '17 20:04 aem

I added some commentary since you mentioned you hadn't played with Promises before. Hopefully it helps :)

zkat avatar Apr 29 '17 21:04 zkat

Oh and also thank you! This is looking great so far 🙆

zkat avatar Apr 29 '17 21:04 zkat

@zkat commentary greatly appreciated :) review fixes and tests coming soon!

aem avatar Apr 30 '17 13:04 aem

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 avatar May 08 '17 22:05 zkat

@zkat can we merge this someday? I was looking for an ability to do this today.

wbern avatar Feb 26 '19 12:02 wbern

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 .

aem avatar Feb 26 '19 14:02 aem

If we want to make sure not to break anything, I think the safe mode should be opt in.

wbern avatar Feb 26 '19 14:02 wbern