@gogd-core/ggd 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/main.js +21 -1
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -603,7 +603,26 @@ function createJenkinsCommand() {
603
603
  jenkins.command("setup").description("Configure Jenkins connection and environment").option("-p, --preset <path>", "Load configuration from a preset JSON file").action(async (opts) => {
604
604
  await runSetup(opts.preset);
605
605
  });
606
- jenkins.command("build").description("Trigger a Jenkins build").argument("[target]", "Build target name").option("-d, --detach", "Run in detached mode (don't watch build)").allowUnknownOption(true).action(async (targetName, opts, cmd) => {
606
+ const buildCmd = new import_commander5.Command("build").description("Trigger a Jenkins build").argument("[target]", "Build target name").option("-d, --detach", "Run in detached mode (don't watch build)").allowUnknownOption(true);
607
+ buildCmd.addHelpText("after", () => {
608
+ const config = readConfig();
609
+ if (!config || config.targets.length === 0) {
610
+ return "\nNo build targets configured. Run: ggd jenkins setup --preset <file>";
611
+ }
612
+ let text = "\nAvailable build targets:\n";
613
+ for (const t of config.targets) {
614
+ text += `
615
+ ${t.name.padEnd(20)} ${t.displayName}
616
+ `;
617
+ for (const [k, v] of Object.entries(t.defaults)) {
618
+ text += ` --${k.padEnd(42)} [default: ${v || "<empty>"}]
619
+ `;
620
+ }
621
+ }
622
+ text += "\nOverride any default: ggd jenkins build <target> --KEY=value";
623
+ return text;
624
+ });
625
+ buildCmd.action(async (targetName, opts, cmd) => {
607
626
  const config = await ensureConfig();
608
627
  if (!config)
609
628
  return;
@@ -667,6 +686,7 @@ Usage: ggd jenkins build <target> [--KEY=value ...]`);
667
686
  process.exitCode = 1;
668
687
  }
669
688
  });
689
+ jenkins.addCommand(buildCmd);
670
690
  jenkins.command("config").description("Show current Jenkins configuration").action(async () => {
671
691
  const config = await ensureConfig();
672
692
  if (!config)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gogd-core/ggd",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "dependencies": {
5
5
  "commander": "12.1.0",
6
6
  "execa": "5.1.1"