@ondrej-svec/hog 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -4011,8 +4011,41 @@ function getGitHubLogin() {
4011
4011
  const user = ghJson(["api", "user"]);
4012
4012
  return user.login;
4013
4013
  }
4014
- function listRepos() {
4015
- return ghJson(["repo", "list", "--json", "nameWithOwner,name,owner", "--limit", "100"]);
4014
+ function listUserOrgs() {
4015
+ try {
4016
+ const orgs = ghJson(["api", "user/orgs"]);
4017
+ return orgs.map((o) => o.login);
4018
+ } catch {
4019
+ return [];
4020
+ }
4021
+ }
4022
+ function listReposForOwner(owner) {
4023
+ const args = [
4024
+ "repo",
4025
+ "list",
4026
+ ...owner ? [owner] : [],
4027
+ "--json",
4028
+ "nameWithOwner,name,owner",
4029
+ "--limit",
4030
+ "100"
4031
+ ];
4032
+ try {
4033
+ return ghJson(args);
4034
+ } catch {
4035
+ return [];
4036
+ }
4037
+ }
4038
+ function listAllRepos() {
4039
+ const orgs = listUserOrgs();
4040
+ const personal = listReposForOwner();
4041
+ const orgRepos = orgs.flatMap((org) => listReposForOwner(org));
4042
+ const all = [...personal, ...orgRepos];
4043
+ const seen = /* @__PURE__ */ new Set();
4044
+ return all.filter((r) => {
4045
+ if (seen.has(r.nameWithOwner)) return false;
4046
+ seen.add(r.nameWithOwner);
4047
+ return true;
4048
+ });
4016
4049
  }
4017
4050
  function listOrgProjects(owner) {
4018
4051
  try {
@@ -4078,7 +4111,8 @@ async function runWizard(opts) {
4078
4111
  const login = getGitHubLogin();
4079
4112
  console.log(` Detected GitHub user: ${login}
4080
4113
  `);
4081
- const allRepos = listRepos();
4114
+ console.log("Fetching repositories...");
4115
+ const allRepos = listAllRepos();
4082
4116
  if (allRepos.length === 0) {
4083
4117
  console.error("No repositories found. Check your GitHub CLI access.");
4084
4118
  process.exit(1);
@@ -4631,7 +4665,7 @@ function resolveProjectId(projectId) {
4631
4665
  process.exit(1);
4632
4666
  }
4633
4667
  var program = new Command();
4634
- program.name("hog").description("Personal command deck \u2014 unified task dashboard for GitHub Projects + TickTick").version("1.1.1").option("--json", "Force JSON output").option("--human", "Force human-readable output").hook("preAction", (thisCommand) => {
4668
+ program.name("hog").description("Personal command deck \u2014 unified task dashboard for GitHub Projects + TickTick").version("1.1.2").option("--json", "Force JSON output").option("--human", "Force human-readable output").hook("preAction", (thisCommand) => {
4635
4669
  const opts = thisCommand.opts();
4636
4670
  if (opts.json) setFormat("json");
4637
4671
  if (opts.human) setFormat("human");