Fix conditional syntax issue in macOS libusb check #9384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This pull request addresses a minor but important syntax issue in the conditional statement used to check for the presence of
libusb
on macOS. Specifically, the original condition:contains a logical expression within a single pair of square brackets
[[ ... ]]
that includes two independent checks joined by&&
. This can potentially lead to incorrect interpretation or unexpected behavior.Issue:
The
[[ ... ]]
syntax in bash doesn't support nested square brackets directly. The correct approach is to separate the two conditions into individual[[ ... ]]
blocks for clarity and to ensure they are evaluated independently.Fix:
The corrected version separates the conditions as follows:
Importance:
Without this fix, the script could potentially misbehave on macOS systems where
libusb
is missing. By splitting the conditions into distinct checks, we ensure that each path is evaluated correctly, preventing errors in the execution of the script.Change Summary:
libusb
to ensure proper evaluation of separate conditions.Thank you for maintaining this project! Let me know if you need any further changes or clarification.