innobead / huber

Huber 📦, Package Install Manager for GitHub repos
Apache License 2.0
184 stars 16 forks source link

Can't install a program from an unmanaged repo (artifact structure pretty similar to a managed one that works: bat) #105

Closed aberges-grd closed 1 year ago

aberges-grd commented 1 year ago

Describe the bug

I have created a yaml file for a repo/cli I'm interested in, the release schema is extremely similar to the bat tool which huber correctly installs. To be more specific, my yaml file is like this:

name: typst
description: A new markup-based typesetting system that is powerful and easy to learn.
source:
  Github:
    owner: typst
    repo: typst
targets:
  - LinuxAmd64:
      artifact_templates:
        - "Typst {version}/typst-x86_64-unknown-linux-gnu.tar.gz"
detail: ~

Inside the tar.gz file there is a folder, the binary is found inside:

typst-x86_64-unknown-linux-gnu/
typst-x86_64-unknown-linux-gnu/LICENSE
typst-x86_64-unknown-linux-gnu/typst
typst-x86_64-unknown-linux-gnu/README.md
typst-x86_64-unknown-linux-gnu/NOTICE

pretty similar to bat:

bat-v0.22.1-i686-unknown-linux-gnu/CHANGELOG.md
bat-v0.22.1-i686-unknown-linux-gnu/LICENSE-APACHE
bat-v0.22.1-i686-unknown-linux-gnu/LICENSE-MIT
bat-v0.22.1-i686-unknown-linux-gnu/README.md
bat-v0.22.1-i686-unknown-linux-gnu/autocomplete/
bat-v0.22.1-i686-unknown-linux-gnu/autocomplete/bat.fish
bat-v0.22.1-i686-unknown-linux-gnu/autocomplete/_bat.ps1
bat-v0.22.1-i686-unknown-linux-gnu/autocomplete/bat.bash
bat-v0.22.1-i686-unknown-linux-gnu/autocomplete/bat.zsh
bat-v0.22.1-i686-unknown-linux-gnu/bat
bat-v0.22.1-i686-unknown-linux-gnu/bat.1

To Reproduce

First, using the aforementioned yaml, add the repo:

> huber repo add typst -f typst.yaml
Repository { name: "typst", url: None, file: Some("typst.yaml") } added

Then attempt to install:

> huber install typst

Installed executables:
 -   # no executables!
typst (version: v23-03-21-2, source: github) installed

The debug log can be found in this gist.

Expected behavior

The package should be installed just like bat.

Environment

huber v0.3.11 Commit: 9b81911-20221212170207

aberges-grd commented 1 year ago

Solved, the artifact template was wrong. Correct one is:

targets:
  - LinuxAmd64:
      artifact_templates:
        - "typst-x86_64-unknown-linux-gnu.tar.gz"