mgunyho / tere

Terminal file explorer
European Union Public License 1.2
1.67k stars 36 forks source link

add homebrew for installation #29

Closed mmathys closed 2 years ago

mgunyho commented 2 years ago

Hi! Thanks for the suggestion. Do you mean homebrew for mac or homebrew for linux? I have zero experience with either, so it might be a while until I get around to doing this, but PRs are welcome!

mmathys commented 2 years ago

For mac. I also don't have experience how to add a homebrew package

superatomic commented 2 years ago

I have experience with adding packages to Homebrew and I would be happy to add tere to Homebrew.

Just so you know, Homebrew for Mac and Linux are the same thing: tere can be added to both in one go.

superatomic commented 2 years ago

@mgunyho I started working on a Homebrew formula for tere, but it looks like adding the wrappers for the different shells is going to be tricky. Homebrew formula (rightfully) shouldn't modify shell configurations, so the installer should inform the user to do so via a caveats section.

I can make specifically tailor the wrappers listed in the README to work with Homebrew, but I'd like to know if you think that these wrappers have any chance of changing in the future (for example, #9 might break all old wrappers), as the formula will have to be manually updated if that happens.

Other than this bit, I have completed the formula for tere, and I can submit a pull request to homebrew/core once this problem is resolved.

davinkevin commented 2 years ago

Homebrew formula (rightfully) shouldn't modify shell configurations, so the installer should inform the user to do so via a caveats section.

One common solution is to add intere files to create for each shell, so as a user, you just have to tere install completions > /path/to/file (this is an example) to generate the file.

davinkevin commented 2 years ago

+1 for tere available from brew, and especially for MacOS if possible. Installation of cargo just to compile it is not something I like to do in my computer 😇

superatomic commented 2 years ago

Homebrew formula (rightfully) shouldn't modify shell configurations, so the installer should inform the user to do so via a caveats section.

One common solution is to add intere files to create for each shell, so as a user, you just have to tere install completions > /path/to/file (this is an example) to generate the file.

That's a great idea! I've seen projects like starship do things this way and it works really well.

I would be willing to implement this feature myself and submit a pull request. @mgunyho do you support using this method of adding the shell wrappers?

superatomic commented 2 years ago

It's probably worth splitting the "add a subcommand for printing shell wrappers" idea into a separate issue, and it would be useful for all methods of installation, not just with Homebrew. I have created #47 for this purpose.

superatomic commented 2 years ago

Additionally, it might be worth it for me to submit my tere formula to homebrew/core before something like #47 or similar is implemented, and to just have the caveats section link to the setup section of the README. That way tere is at least able to be installed with Homebrew.

What are everyone's thoughts on this?

mgunyho commented 2 years ago

Thanks @superatomic ! I think for now it's a good idea to just put the shell instructions in the caveats section. Feel free to submit the PR. How is the binary provided for homebrew? Will somebody have to build tere for Mac?

Currently I'm not planning to merge #9, it was more of a note to self after seeing how others like ranger and nnn do it. Maybe it can be added as an option, but for now let's say that the default will be to always just print to stdout.

superatomic commented 2 years ago

I think for now it's a good idea to just put the shell instructions in the caveats section. Feel free to submit the PR.

Sounds good, although I think it would be beneficial to eventually get #46 implemented.

How is the binary provided for homebrew? Will somebody have to build tere for Mac?

The tere formula provides instructions on how to build tere from source. The formula is built on Homebrew's dedicated hardware and stored as a "bottle". When users run brew install tere, they download the prebuilt binary (and all other files) from the bottle, without having to build it themselves.

It is also possible to tell Homebrew to build from source locally during installation.

superatomic commented 2 years ago

tere is now in homebrew/core! :tada:

You can now install tere by running brew install tere. (You will probably have to run brew update beforehand to pull the new formula)

While tere is in Homebrew now, I recommend that this issue stays open until #49 is closed.