devops-works / binenv

One binary to rule them all. Manage all those pesky binaries (kubectl, helm, terraform, ...) easily.
MIT License
373 stars 44 forks source link

Wrong binary is installed when there are multiple files with same binary basename #261

Open dieddc opened 2 months ago

dieddc commented 2 months ago

Example tool fd

installing this on amd system will choose the asset fd-v10.1.0-x86_64-unknown-linux-gnu.tar This archive has the files: fd 4Mb is the correct binary fd.1 17k, not a binary

When installing this the second file will be installed.

current config:

  fd:
    description: A simple, fast and user-friendly alternative to 'find'
    url: https://github.com/sharkdp/fd/
    list:
      type: github-releases
      url: https://api.github.com/repos/sharkdp/fd/releases
    fetch:
      url: https://github.com/sharkdp/fd/releases/download/v{{ .Version }}/fd-v{{ .Version }}-x86_64-unknown-{{ .OS }}-gnu.tar.gz
    install:
      type: tgz
      binaries:
        - fd
dieddc commented 2 months ago

Found the solution for this problem. It's possible to enter a regexp value for binaries. In this case the solution is

    install:
      type: tgz
      binaries:
        - "^fd$"
leucos commented 2 months ago

Yes indeed. Thanks for reporting. Would you like to send a PR ?