6

I'm writing a custom Heroku buildpack (heroku-buildpack-fantom) for Fantom, and as part of the compile script I've downloaded a .zip file (from a language vendor), but how do I unzip it?

unzip is not a recognised command.

gunzip exists but I can't use it to unzip .zip files.

What am I missing?

Steve Eynon
  • 4,979
  • 2
  • 30
  • 48

2 Answers2

10

Even though (by default) Linux does not come pre-installed with unzip, the Heroku dyno does have a jar command. So the following works okay:

  > jar xf wotever.zip
Steve Eynon
  • 4,979
  • 2
  • 30
  • 48
  • If you want to specify an output directory `mkdir /tmp/target; cd /tmp/target` does the job. `jar` has an option `-C` but seems not working for extracting. As a side note, `rake` can't run `cd` you need to use `Dir.chdir`. – Nobu Feb 06 '15 at 02:03
0

Be sure to run the 'file' command on it. I got a .zip file from SourceForge that was actually bzip2 encoded and Heroku has both the bunzip2 decoder and the -j (--bzip2) option on tar to handle it.

Guy Lancaster
  • 219
  • 4
  • 6
  • Cheers, I had never heard of the `file` command: [file is a standard Unix program for recognizing the type of data contained in a computer file.](http://en.wikipedia.org/wiki/File_%28command%29) – Steve Eynon Aug 23 '13 at 08:43