Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract multiple files from archive #68

Open
Entze opened this issue Oct 17, 2024 · 5 comments
Open

Extract multiple files from archive #68

Entze opened this issue Oct 17, 2024 · 5 comments

Comments

@Entze
Copy link

Entze commented Oct 17, 2024

When installing the Helix-Editor with ubi, the binary is downloaded correctly, however the runtime directory, containing tree-sitter definitions, themes and the tutor are missing.

As a user I would like to specify a path (maybe multiple) of resources that are extracted along side the single binary, such that static configuration files are not missing.

Let me know if you need any more insights or help.

@autarch
Copy link
Member

autarch commented Oct 21, 2024

This is something I've thought about a little bit, but not in great detail. I think maybe the best option is just to have a way to extract either just one file (the executable) or to just dump all the contents of the archive under one directory.

@Entze
Copy link
Author

Entze commented Oct 21, 2024

That might be a good approach in case a project provides multiple binaries as well.

It might be beneficial to gather usecases/projects where such a setting would be useful. I will look through the tools I use and gather usecases if you don't mind.

@autarch
Copy link
Member

autarch commented Oct 21, 2024

It might be beneficial to gather usecases/projects where such a setting would be useful. I will look through the tools I use and gather usecases if you don't mind.

Yes, please. I'd be interested in knowing more about these use cases.

@Entze
Copy link
Author

Entze commented Nov 5, 2024

A review of the apps/tools I use, showed ubi in relation to the following situations:

  • works out of the box (most Rust or Go binaries)
  • optional files missing (same directory) (helix)
  • optional files missing (specific directories, in this case shell completions) (gum, glow)
  • only distribution/operating system specific package format available (flox)
  • Not compiled yet (dateutils)

Importantly, to reiterate, I'm not asking for the scope to be expanded to cover all those cases.

@kabouzeid
Copy link

kabouzeid commented Nov 9, 2024

I'd also love to have that functionality. Right now, I rely on hardcoded wget, tar, and ln commands in my dotfiles to download GitHub releases, extract their contents, and link binaries, completions, and man pages to the appropriate locations. It would be great if ubi could handle finding the correct links and extraction steps. I’d still manually link completions and man pages to the right places since that process often varies across packages and may be challenging to automate fully in ubi.

For reference: install-binaries.conf.yaml

Example:

# download musl release, extract to ~/.local/share/packages
cd ~/.local/share/packages
wget "https://github.com/chmln/sd/releases/download/v1.0.0/sd-v1.0.0-x86_64-unknown-linux-musl.tar.gz" -O - | tar -xz;

# link binary, fish completion, man page
ln -s ~/.local/share/packages/sd-v1.0.0-x86_64-unknown-linux-musl/sd ~/.local/bin/sd
ln -s ~/.local/share/packages/sd-v1.0.0-x86_64-unknown-linux-musl/completions/sd.fish ~/.local/share/fish/vendor_completions.d/sd.fish
ln -s ~/.local/share/packages/sd-v1.0.0-x86_64-unknown-linux-musl/sd.1 ~/.local/share/man/man1/sd.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants