phylum-dev / cli

Command line interface for the Phylum API
https://phylum.io
GNU General Public License v3.0
99 stars 10 forks source link

Improve robustness of find-permissions extensions #1450

Closed cd-work closed 2 weeks ago

cd-work commented 2 weeks ago

This patch adds two minor changes that should make the find-permissions extensions easier to use for people unfamiliar with it.

To ensure we don't incorrectly log that / is required when the command always fails, the extension now does an explicit check on / and outputs a detailed error on the issue.

While I wasn't able to reproduce this issue myself, there have been some reports on failures due to permission errors. To avoid the possibility of that we now explicitly handle Deno.readDir failures and just assume the corresponding directory is wholly required.

To improve consistency, all console.error calls have been changed to use red color.