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

feat: option to produce TAR archives #15

Merged
merged 1 commit into from
Oct 4, 2019
Merged

Conversation

lidel
Copy link
Member

@lidel lidel commented Oct 3, 2019

This PR adds opt-in "archive mode" which produces TAR archive, matching ipfs get:

  • --archive produces .tar instead of unpacked directory tree
  • --archive --compress produces .tar.gz

Demo

types of output:

$ npx ipfs-or-gateway -c QmPURAjo3oneGH53ovt68UZEBvsc8nNmEhQZEpsVEQUMZE -p TEST 
$ npx ipfs-or-gateway -c QmPURAjo3oneGH53ovt68UZEBvsc8nNmEhQZEpsVEQUMZE -p TEST --archive 
$ npx ipfs-or-gateway -c QmPURAjo3oneGH53ovt68UZEBvsc8nNmEhQZEpsVEQUMZE -p TEST --archive --compress

produce:

22M	  TEST/
22M	  TEST.tar
6.6M  TEST.tar.gz

My Use Case

I want to include uncompressed .tar with WebUI in ipfs-companion bundle (to avoid double gzipping) for Brave (ipfs/ipfs-companion#716) and do ipfs.add on first boot to make initial WebUI load fast and work in offline mode (ipfs/ipfs-companion#765).

adds opt-in "archive mode" which produces TAR archive, matching ipfs
get.

--archive produces .tar file instead of an unpacked directory tree
--archive --compress produces a .tar.gz file

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@lidel lidel requested a review from hacdias October 3, 2019 21:07
Copy link
Member

@hacdias hacdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the updates you've made!

@hacdias hacdias merged commit c3ad91a into master Oct 4, 2019
@hacdias hacdias deleted the feat/tar-archive-mode branch October 4, 2019 07:05
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

Successfully merging this pull request may close these issues.

2 participants