zyedidia / eget

Easily install prebuilt binaries from GitHub.
MIT License
866 stars 39 forks source link

`eget errata-ai/vale --asset 64-bit.tar` says `open vale: is a directory` #68

Closed dflock closed 1 year ago

dflock commented 1 year ago

When I run eget errata-ai/vale --asset 64-bit.tar I get this:

➜ `eget errata-ai/vale --asset 64-bit.tar`
https://github.com/errata-ai/vale/releases/download/v2.22.0/vale_2.22.0_Linux_64-bit.tar.gz
Downloading 100% [====================================================] (6.8/6.8 MB, 14.755 MB/s)        
open vale: is a directory

However, if I download that file manually and unpack it, I get this:

➜ wget https://github.com/errata-ai/vale/releases/download/v2.22.0/vale_2.22.0_Linux_64-bit.tar.gz
...
Saving to: ‘vale_2.22.0_Linux_64-bit.tar.gz’

vale_2.22.0_Linux_64-bit.t 100%[======================================>]   6.85M  20.7MB/s    in 0.3s    

2023-02-04 13:47:00 (20.7 MB/s) - ‘vale_2.22.0_Linux_64-bit.tar.gz’ saved [7180999/7180999]

➜ mkdir vale
➜ cd vale

➜ tar xzf ../vale_2.22.0_Linux_64-bit.tar.gz 

➜ ls -halp
total 15M
drwxrwxr-x 1 duncan duncan   40 Feb  4 13:47 ./
drwxr-xr-x 1 duncan duncan 3.9K Feb  4 13:47 ../
-rw-r--r-- 1 duncan duncan 1.1K Jan  9 15:35 LICENSE
-rw-r--r-- 1 duncan duncan 9.8K Jan  9 15:35 README.md
-rwxr-xr-x 1 duncan duncan  15M Jan  9 15:36 vale

It looks to me like that tar file contain vale a 15 mb binary. Not sure why eget thinks it's a folder?

zyedidia commented 1 year ago

What version of eget are you using? I just tried using version 1.3.1 and it worked as expected.

dflock commented 1 year ago

Yeah, latest 1.3.1

zyedidia commented 1 year ago

Is it possible that at the location eget is trying to extract the binary vale to there is already a directory called vale? (Either the current directory or your EGET_PATH if it is set)

dflock commented 1 year ago

If I run this from my home directory, there is a value folder there already and it fails - if I run it somewhere else where there isn't, it works. However - this is what my config looks like:

➜ cat ~/.config/eget/eget.toml 
[global]
target = "~/bin"
upgrade_only = true

So, running it from my home directory fails because there's already a vale folder there - even through it's supposed to be putting the download into "~/bin"?

If I run this from my home directory (where there's already a vale folder) eget errata-ai/vale --asset 64-bit.tar --to ~/bin it works as expected and happily puts vale into ~/bin.

So, it looks like my config file isn't working, for some reason? (I didn't notice this initially because I happened to be running eget from ~/bin).

zyedidia commented 1 year ago

Ah, putting the eget configuration in ~/.config/eget/eget.toml (on the XDG path) is a feature that has been added since v1.3.1. For version 1.3.1 you should use ~/.eget.toml. I will release a new version shortly.