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

Report all missing dependencies at once #582

Closed
DannyBen opened this issue Dec 24, 2024 Discussed in #580 · 2 comments
Closed

Report all missing dependencies at once #582

DannyBen opened this issue Dec 24, 2024 Discussed in #580 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@DannyBen
Copy link
Owner

Discussed in #580

Originally posted by meleu December 24, 2024
First of all: WOW! 😮

As bash-lover for more than 2 decades, I'm amazed by this project! This is a life-changing tool! Thanks for sharing it with us! ❤️

Now the feature idea:


When the script has more than one dependency and the user doesn't have any of them installed, it is a frustrating experience to see only one "missing dependency" notification at each time you try to run the script.

It would be nice if the dependency checking could report all missing dependencies in a single run.

I'm sharing here what I usually do (in a hope it can give you some ideas):

# declare the dependencies in an array
readonly DEPENDENCIES=(dep1 dep2 depN)

# checkDependencies:
# prints the missing dependency
# finishes with failure status when a missing dependency is found
checkDependencies() {
  local dep
  local failure=false

  for dep in "${DEPENDENCIES[@]}"; do
    command -v "$dep" > /dev/null && continue
    echo "[ERROR]: '$dep' is not in your PATH" >&2
    failure=true
  done

  [[ "$failure" == 'false' ]]
}
```</div>
@DannyBen DannyBen added the enhancement New feature or request label Dec 24, 2024
@DannyBen DannyBen added this to the 1.2.7 milestone Dec 24, 2024
@DannyBen DannyBen self-assigned this Dec 24, 2024
@DannyBen
Copy link
Owner Author

@meleu - this feature is implemented in #583.
Do you wish to test it?

@meleu
Copy link

meleu commented Dec 24, 2024

sure! I'm on it right now 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants