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

chore: Use command -v over which for portability #1658

Merged

Commits on Mar 22, 2022

  1. [packaging] Use 'command -v' over 'which' for portability

    'command -v' is a POSIX safe way to find an executable program.
    While 'which' is very common, it still requires installation on many
    Linux operating systems, and so 'command -v' can offer a more portable
    alternative with a very low amount of additional cognitive overhead on
    the maintainers.
    
    Additionally, use a subshell, $(), over backticks for command substitution
    as $() is recommended for multiple reasons including readability.
    c.f.:
    * https://stackoverflow.com/a/4708569/8931942
    * Why is $(...) preferred over `...` (backticks)?
       - http://mywiki.wooledge.org/BashFAQ/082
    * POSIX spec for Command Substitution
       - https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03
    matthewfeickert committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    8d6b47b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7d98c17 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    95122ad View commit details
    Browse the repository at this point in the history