Closed unrealapex closed 2 months ago
?
Test is redundant for this. My apologies!
the current code checks for a non error exit code which is the recommended and most robust way. your PR changes it to check for whether the command prints anything, which is a very bad way of doing it and could easily lead to false positives if some implementation printed 'command not found'
before trying to make further contributions, please consider whether your contributions are actually productive. there is little point changing code that is not broken. prs should add (good) features or fix bugs, not refactor random code
the current code checks for a non error exit code which is the recommended and most robust way.
I had not remembered that, I had made the assumption that using command substitution was the de facto way to compare exit codes. Thank you for pointing that out.
Use test for the privilege escalation logic instead of running commands and redirecting stdout.