chiefwiggum 1.3.19 → 1.3.21
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.cjs +44 -6
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -816,7 +816,19 @@ function checkGitHubCLI() {
|
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
818
|
async function setupProjectConfig() {
|
|
819
|
+
const existingConfig = getConfig();
|
|
819
820
|
if ((0, import_node_fs3.existsSync)(CONFIG_FILE)) {
|
|
821
|
+
if (existingConfig.projectTracker === "github" && existingConfig.githubProject === void 0) {
|
|
822
|
+
const ghCheck = checkGitHubCLI();
|
|
823
|
+
if (ghCheck.ok) {
|
|
824
|
+
const projectName = await selectOrCreateProjectBoard(ghCheck.repo);
|
|
825
|
+
const config3 = { ...existingConfig, githubProject: projectName };
|
|
826
|
+
saveConfig(config3);
|
|
827
|
+
if (projectName) {
|
|
828
|
+
console.log(import_picocolors7.default.green(`\u2713 Project board saved: ${projectName}`));
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
820
832
|
return;
|
|
821
833
|
}
|
|
822
834
|
console.log();
|
|
@@ -920,10 +932,23 @@ async function selectOrCreateProjectBoard(knownRepo) {
|
|
|
920
932
|
});
|
|
921
933
|
console.log(import_picocolors7.default.cyan(`Creating board "${projectName}"...`));
|
|
922
934
|
try {
|
|
923
|
-
(0, import_node_child_process6.execSync)(
|
|
924
|
-
|
|
925
|
-
|
|
935
|
+
const createOutput = (0, import_node_child_process6.execSync)(
|
|
936
|
+
`gh project create --owner ${repoName.split("/")[0]} --title "${projectName}"`,
|
|
937
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
938
|
+
);
|
|
939
|
+
const projectNumberMatch = createOutput.match(/projects\/(\d+)/);
|
|
940
|
+
const projectNumber = projectNumberMatch ? projectNumberMatch[1] : null;
|
|
926
941
|
console.log(import_picocolors7.default.green(`\u2713 Board "${projectName}" created`));
|
|
942
|
+
if (projectNumber) {
|
|
943
|
+
try {
|
|
944
|
+
(0, import_node_child_process6.execSync)(`gh project link ${projectNumber} --owner ${repoName.split("/")[0]} --repo ${repoName}`, {
|
|
945
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
946
|
+
});
|
|
947
|
+
console.log(import_picocolors7.default.green(`\u2713 Linked to ${repoName}`));
|
|
948
|
+
} catch {
|
|
949
|
+
console.log(import_picocolors7.default.dim(` Note: Board created at org level. Link manually from repo's Projects tab.`));
|
|
950
|
+
}
|
|
951
|
+
}
|
|
927
952
|
return projectName;
|
|
928
953
|
} catch {
|
|
929
954
|
console.log(import_picocolors7.default.yellow("Could not create board. Issues will be created without one."));
|
|
@@ -1376,10 +1401,23 @@ async function selectOrCreateProjectBoard2(knownRepo) {
|
|
|
1376
1401
|
});
|
|
1377
1402
|
console.log(import_picocolors9.default.cyan(`Creating board "${projectName}"...`));
|
|
1378
1403
|
try {
|
|
1379
|
-
(0, import_node_child_process7.execSync)(
|
|
1380
|
-
|
|
1381
|
-
|
|
1404
|
+
const createOutput = (0, import_node_child_process7.execSync)(
|
|
1405
|
+
`gh project create --owner ${repoName.split("/")[0]} --title "${projectName}"`,
|
|
1406
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
1407
|
+
);
|
|
1408
|
+
const projectNumberMatch = createOutput.match(/projects\/(\d+)/);
|
|
1409
|
+
const projectNumber = projectNumberMatch ? projectNumberMatch[1] : null;
|
|
1382
1410
|
console.log(import_picocolors9.default.green(`\u2713 Board "${projectName}" created`));
|
|
1411
|
+
if (projectNumber) {
|
|
1412
|
+
try {
|
|
1413
|
+
(0, import_node_child_process7.execSync)(`gh project link ${projectNumber} --owner ${repoName.split("/")[0]} --repo ${repoName}`, {
|
|
1414
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
1415
|
+
});
|
|
1416
|
+
console.log(import_picocolors9.default.green(`\u2713 Linked to ${repoName}`));
|
|
1417
|
+
} catch {
|
|
1418
|
+
console.log(import_picocolors9.default.dim(` Note: Board created at org level. Link manually from repo's Projects tab.`));
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1383
1421
|
return projectName;
|
|
1384
1422
|
} catch {
|
|
1385
1423
|
console.log(import_picocolors9.default.yellow("Could not create board."));
|