sholladay / pogo

Server framework for Deno
Mozilla Public License 2.0
482 stars 32 forks source link

Update curl command to download examples #24

Closed PKief closed 4 years ago

PKief commented 4 years ago

Running the tar command without the -z option will fail to download the project files and prompt you the following error:

curl -fsSL https://github.com/sholladay/pogo/archive/master.tar.gz | tar -x --strip-components=1 'pogo-master/example'
tar: Archive is compressed. Use -z option
tar: Error is not recoverable: exiting now
curl: (23) Failed writing body (0 != 1363)

This pull requests add the z option to the tar command and lets it download the files properly.

sholladay commented 4 years ago

Makes sense but weird because I'm pretty sure it worked for me before. I wonder if this could be due to platform differences. Which OS did this happen on? I mainly use macOS.

Will test when I'm back at my terminal later today. Otherwise should be good to go. Thanks for the PR!

PKief commented 4 years ago

I executed this command on a Ubuntu 18.04.2 LTS system. And I also tried to execute it with a git bash on Windows and got the same error.

sholladay commented 4 years ago

Yep, this seems to explains it, on macOS I ran man tar and the manpage contains this:

-z      (c mode only) Compress the resulting archive with gzip(1).  In extract or list modes, this option is
        ignored.  Note that, unlike other tar implementations, this implementation recognizes gzip compression
        automatically when reading archives.

So I've been relying on the automatic detection for quite some time without thinking about it.

Thanks!