ljharb / repo-report

CLI to list all repos a user has access to, and report on their configuration in aggregate.
MIT License
24 stars 11 forks source link

Possibility of refactoring/extracting getRepositories? #50

Open ljharb opened 2 years ago

ljharb commented 2 years ago

The combination of https://github.com/ljharb/repo-report/blob/main/src/commands/detail.js#L41 and https://github.com/ljharb/repo-report/blob/main/src/utils.js#L111 is what's used to get a list of all the repos I care about.

First, now that we only have one command left (#48), we can probably refactor so that getRepositories is one single function.

Second, there are other use cases where I'll want to perform an action on "every repo i care about" - so it might be nice to extract that function into a separate package, so other things can reuse it.

Riyabelle25 commented 2 years ago

@ljharb is this what you'd been talking about before - i.e adding an option in repo-report to output all the repositories returned by funcgetRepositories? So that repo-report-cache, can run repo-report -<new option> to get all repos of a user?

ljharb commented 2 years ago

Yes, exactly.

Riyabelle25 commented 2 years ago

Right, I've coded in a new option names alias n that does this. Shall I make a PR mentioning this issue?

ljharb commented 2 years ago

I don’t think it needs a short option, just the long one, but yes, that sounds great :-)