ThatOneCalculator / NerdFetch

A POSIX *nix fetch script using Nerdfonts
https://aur.archlinux.org/packages/nerdfetch/
MIT License
478 stars 24 forks source link

Use 'command -v' instead of 'which' #2

Closed khuei closed 4 years ago

khuei commented 4 years ago

Use shell built-in command -v to eliminate the need for which external command.

ThatOneCalculator commented 4 years ago

Problem is, command -v looks at all commands while command which only looks at executable commands, preventing edge cases such as aliasing one package manager name to another.

ThatOneCalculator commented 4 years ago

If there's a way without using which to only get executable commands from command lmk, but I think it's better to account for edge cases rather than reduce external commands.

eepykate commented 4 years ago

Problem is, command -v looks at all commands while command which only looks at executable commands, preventing edge cases such as aliasing one package manager name to another.

Not an issue in scripts. Aliases don't carry over to scripts.

ThatOneCalculator commented 4 years ago

Fair enough. Since the branch you edited was old I just put the -v on the latest commit.

eepykate commented 4 years ago

I'm sure that was completely unrelated to replying after 15 hours :)

ThatOneCalculator commented 4 years ago

Also update command -v didnt even work >:C