Commit Graph

4 Commits

Author SHA1 Message Date
Daniel Lockyer
8d9e26cb83 Switched symlink to symlinkSync
- we don't provide a callback for this so we want it synchronous
  but `symlink` is async. Switching to `symlinkSync` should now fix the
  flaky tests
2020-11-10 10:48:25 +00:00
Daniel Lockyer
d3459271bf Updated zip test to reflect intended behaviour
- the symlink test has been failing for some time because recent minors
  of Node 12 produce different size zip files
- we were checking that the produced zip is a specific size, but we
  basically just want to check it's smaller than the original folder
- this commit updates the test with the size of the original folder,
  found by running `du -b test/fixtures/test-theme/`
2020-08-04 13:05:34 +01:00
Hannah Wolfe
7964f6ec82 Added dotfile support and set it on by default
refs https://github.com/TryGhost/Ghost/issues/11794

- archiver has an undocumented dot option, that allows you to include dotfiles
- our existing tests had a dotfile, but we didn't check properly that everything exists
- Swapped to using folder-hash to compare if the original, and compressed-then-decompressed folders are identical
- Added an example of a dotfolder with nested dotfile
- Updated compress to use the dot option, make it optional but on by default
2020-05-08 16:21:20 +01:00
Hannah Wolfe
adfb3fe499 Consistent interface and response
- Creating a better, more long-term API here
- compress and extract are opposite, neat terms
- Use new Promise to get rid of callback argument when using archiver to compress a folder
- Add options argument, and make a couple of key details configurable
- Make the response intelligable
- Ensure both functions are consistent
- Updated tests to match
2020-04-08 12:48:20 +01:00