arkade icon indicating copy to clipboard operation
arkade copied to clipboard

Unable to unzip Lens for new app

Open rberrelleza opened this issue 5 years ago • 11 comments

I was trying to add Lens to arkade. When trying to download it on a mac, arkade failed to unzip the file.

Expected Behaviour

Lens would be downloaded, extracted, and the binary placed in the arkade bin folder

Current Behaviour

arkade get lens fails with the following error:

Error: error creating zip reader: zip: not a valid zip file

This is generated on the call to unzip.Unzip, line 20.

Looking at the code, there aren't any other applications that use zip for MacOS, so there might be something on the unzip code that doesn't work well for that specific OS.

Possible Solution

Steps to Reproduce (for bugs)

  1. git clone https://github.com/rberrelleza/arkade
  2. cd arkade
  3. git checkout install-lens
  4. make
  5. ./arkade get lens

Your Environment

  • Operating System and version (e.g. Linux, Windows, MacOS):

MacOS Catalina 10.15.4

  • What arkade version is this? Latest from master

rberrelleza avatar Aug 21 '20 05:08 rberrelleza

/set title: Unable to unzip Lens for new app

alexellis avatar Aug 21 '20 07:08 alexellis

@tuananh @Amalkh5 do you have any suggestions? Could this be specific to the format of zip that lens is using?

alexellis avatar Aug 21 '20 07:08 alexellis

@alexellis i think this is specific to format the lens is using because they are using dmg. And i would suggest to update zip code to support that format.

amalkh5 avatar Aug 21 '20 08:08 amalkh5

DMG zip file?

alexellis avatar Aug 21 '20 08:08 alexellis

I think i was wrong with unzip the .dmg because this format is not archive type file.

Maybe the solution is to support .dmg in get command by mount and then install the app.

amalkh5 avatar Aug 21 '20 09:08 amalkh5

@Amalkh5 @alexellis in my branch I'm downloading the zip file for MacOS, not the dmg. (https://github.com/rberrelleza/arkade/blob/install-lens/pkg/get/tools.go#L323).

rberrelleza avatar Aug 21 '20 16:08 rberrelleza

Zip files worked elsewhere. Can you look into why theirs isn't supported Ramiro?

alexellis avatar Aug 21 '20 16:08 alexellis

@alexellis @rberrelleza I tried to unzip the file through the command line and i got the following error:

$ unzip Lens-3.5.3-mac.zip 
Archive:  Lens-3.5.3-mac.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of Lens-3.5.3-mac.zip or
        Lens-3.5.3-mac.zip.zip, and cannot find Lens-3.5.3-mac.zip.ZIP, period.

amalkh5 avatar Aug 23 '20 19:08 amalkh5

Interesting @Amalkh5 ! I unzipped it by double clicking on it and it work fine. Wonder was different between that and using unzip

rberrelleza avatar Aug 23 '20 23:08 rberrelleza

The Linux option appears to be a .AppImage extension.. what is that?

I also got an issue with unzip:

kosmos:tmp alex$ unzip Lens-3.6.0-rc.1-mac.zip
Archive:  Lens-3.6.0-rc.1-mac.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of Lens-3.6.0-rc.1-mac.zip or
        Lens-3.6.0-rc.1-mac.zip.zip, and cannot find Lens-3.6.0-rc.1-mac.zip.ZIP, period.
kosmos:tmp alex$ 

It appears to actually be a tar.gz with the wrong extension.

tar -xvf Lens-3.6.0-rc.1-mac.zip

alexellis avatar Sep 08 '20 08:09 alexellis

@alexellis appimage is like DMG for linux, first time I've seen one in github (https://appimage.org/).

It appears to actually be a tar.gz with the wrong extension.

That explains the error I saw. Should we close this since it's an external issue?

rberrelleza avatar Sep 09 '20 16:09 rberrelleza