walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
587 stars 17 forks source link

[Bug] Moar suggests setting wrong path as the environment variable for becoming the default pager #88

Closed hiddeninthesand closed 2 years ago

hiddeninthesand commented 2 years ago

When running moar --help, Moar will suggest that you add it to your .bashrc file as your default pager, alongside the line required, for example:

To make Moar your default pager, put the following line in
your .bashrc or .bash_profile and it will be default in all
new terminal windows:
   export PAGER=/path/to/binary

This (potentially) incorrectly assumes that the moar application file is in your current working directory, which can lead to recommending the user the wrong line to insert into their .bashrc file.

walles commented 2 years ago

Which version of moar is this (moar --version)?

When I try the same thing with v1.9.1 I get:

To make Moar your default pager, put the following line in
your .bashrc or .bash_profile and it will be default in all
new terminal windows:
   export PAGER=/Users/johan/src/moar/moar

Here's the current code for reference: https://github.com/walles/moar/blob/faa833fe4ec2b90d0621052f2b30e29074e3048a/moar.go#L57-L73

hiddeninthesand commented 2 years ago

v1.9.1, same as you. I have it installed at /usr/bin/moar, but if I run it from another working directory it assumes that the binary is in the working directory, instead of /usr/bin/. What working directory did you run moar --help in?

walles commented 2 years ago

You are right, thanks for reporting!

I will look into this and make sure it's done properly.

hiddeninthesand commented 2 years ago

Appreciate it!

walles commented 2 years ago

Made a new release for it, Homebrew status here: https://github.com/Homebrew/homebrew-core/pull/99564

hiddeninthesand commented 2 years ago

Looks good, already pushed it to the MPR.