zyedidia / eget

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

Weird behaviour when using 'file' in config #103

Closed kwekewk closed 2 months ago

kwekewk commented 2 months ago

when used, it ignore asset_filters

$ tail -3 .eget.toml 
["dopplerhq/cli"]
asset_filters = [ "tar.gz" , "^sig" ]
file = [ "doppler" ]

$ eget dopplerhq/cli 
8 matches found: please select manually
(1) doppler_3.68.0_linux_amd64.apk
(2) doppler_3.68.0_linux_amd64.apk.sig
(3) doppler_3.68.0_linux_amd64.deb
(4) doppler_3.68.0_linux_amd64.deb.sig
(5) doppler_3.68.0_linux_amd64.rpm
(6) doppler_3.68.0_linux_amd64.rpm.sig
(7) doppler_3.68.0_linux_amd64.tar.gz
(8) doppler_3.68.0_linux_amd64.tar.gz.sig
Enter selection number: 

if we remove, it still prompt which file; cannot work for non-interactive usage

$ tail -3 .eget.toml 

["dopplerhq/cli"]
asset_filters = [ "tar.gz" , "^sig" ]

$ eget dopplerhq/cli 
https://github.com/DopplerHQ/cli/releases/download/3.68.0/doppler_3.68.0_linux_amd64.tar.gz
Downloading 100% [===============================================================================] (4.2/4.2 MB, 185.970 MB/s)
2 candidates for target exe `cli` found: please select manually
(1) LICENSE
(2) doppler
(3) all
Enter selection number: 
zyedidia commented 2 months ago

This is a case of the configuration file being malformed. In prior versions Eget did not report this error. With the latest version, you should see:

.eget.toml: toml: line 3 (last key "\"dopplerhq/cli\".file"): incompatible types: TOML value has type []interface {}; destination has type string

Instead you should use

file = "doppler"