create-egregore 0.12.2 → 0.12.4
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/lib/local.js +20 -25
- package/package.json +1 -1
package/lib/local.js
CHANGED
|
@@ -187,11 +187,21 @@ function createSymlink(egregoreDir, memoryDir, ui) {
|
|
|
187
187
|
ui.success("Linked");
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
// GitHub App installation URL — grants Egregore access to repos the user selects
|
|
191
|
+
const APP_INSTALL_URL = "https://github.com/apps/egregore-labs/installations/new";
|
|
192
|
+
|
|
190
193
|
// ── Flow 1: Founder (local mode) ───────────────────────────────────
|
|
191
194
|
|
|
192
195
|
async function localFounderFlow(ui) {
|
|
193
|
-
// 1. GitHub
|
|
194
|
-
ui.info("Let's set up Egregore
|
|
196
|
+
// 1. Install GitHub App — user picks which repos/accounts to grant access to
|
|
197
|
+
ui.info("Let's set up Egregore.\n");
|
|
198
|
+
ui.info("First, install the Egregore app on your GitHub account.");
|
|
199
|
+
ui.info("You'll choose exactly which repos to share.\n");
|
|
200
|
+
openBrowser(APP_INSTALL_URL);
|
|
201
|
+
await ui.prompt("Press Enter when done...");
|
|
202
|
+
|
|
203
|
+
// 2. GitHub auth (auto-approved after App install)
|
|
204
|
+
ui.info("");
|
|
195
205
|
let githubToken;
|
|
196
206
|
try {
|
|
197
207
|
githubToken = await deviceFlow(ui);
|
|
@@ -627,34 +637,19 @@ async function localJoinFlow(orgArg, ui) {
|
|
|
627
637
|
: `${orgLogin}-memory`;
|
|
628
638
|
const managedRepos = config.repos || [];
|
|
629
639
|
|
|
630
|
-
// 5b. Check access to memory repo
|
|
631
|
-
|
|
632
|
-
const inaccessible = [];
|
|
633
|
-
for (const repo of additionalRepos) {
|
|
634
|
-
if (!(await repoExists(githubToken, orgLogin, repo))) {
|
|
635
|
-
inaccessible.push(repo);
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
if (inaccessible.length > 0) {
|
|
640
|
+
// 5b. Check access to memory repo (required) — may need invitation acceptance
|
|
641
|
+
if (!(await repoExists(githubToken, orgLogin, memoryRepoName))) {
|
|
639
642
|
console.log("");
|
|
640
|
-
ui.info(
|
|
641
|
-
|
|
642
|
-
openBrowser(`https://github.com/${orgLogin}/${repo}`);
|
|
643
|
-
}
|
|
643
|
+
ui.info("Accept the memory repo invitation in your browser.");
|
|
644
|
+
openBrowser(`https://github.com/${orgLogin}/${memoryRepoName}`);
|
|
644
645
|
await ui.prompt("Press Enter after accepting...");
|
|
645
646
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
stillBlocked.push(repo);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
if (stillBlocked.length > 0) {
|
|
653
|
-
ui.error(`Still can't access: ${stillBlocked.join(", ")}`);
|
|
654
|
-
ui.error("Make sure you've been invited to all repos.");
|
|
647
|
+
if (!(await repoExists(githubToken, orgLogin, memoryRepoName))) {
|
|
648
|
+
ui.error(`Still can't access ${orgLogin}/${memoryRepoName}`);
|
|
649
|
+
ui.error("Make sure the org admin has invited you to the memory repo.");
|
|
655
650
|
process.exit(1);
|
|
656
651
|
}
|
|
657
|
-
ui.success("
|
|
652
|
+
ui.success("Access confirmed");
|
|
658
653
|
}
|
|
659
654
|
|
|
660
655
|
// 6. Clone locally
|