mrlunchbox777 / basic-setup

basic box setup
MIT License
6 stars 3 forks source link

feature: Improve command-installed #160

Open mrlunchbox777 opened 5 months ago

mrlunchbox777 commented 5 months ago

Contact Details

mrlunchbox777@gmail.com

Feature Description

Improve the command-installed function by supporting more types of command installations, particularly aliases and package bundles/libraries.

Why?

There are managed packages (omz, nvm, moreutils) that command-installed currently, incorrectly, returns false.

What should happen?

This is not a bug because we handle it in different ways right now, but they are bespoke workarounds.

command-installed needs to support different package installations, this is probably most easily done by importing aliases then testing for them, using the package managers themselves, using command -v, and using which and ||ing the result.

Covers this TODO, and this TODO.

Steps to Test

  1. Install omz, nvm, and moreutils.
  2. general-command-installed -c omz should return true
  3. general-command-installed -c nvm should return true
  4. general-command-installed -c moreutils should return true

Code of Conduct