@genex-ai/cli-demo 0.1.1 → 0.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.
Files changed (2) hide show
  1. package/dist/index.js +19 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -739,10 +739,11 @@ async function runPublish(opts) {
739
739
  return;
740
740
  }
741
741
  const apiUrl = getApiUrl(opts.apiUrl ?? meta.apiUrl);
742
+ let pushed = null;
742
743
  if (opts.noPush) {
743
744
  log.info("Skipping git push (--no-push).");
744
745
  } else {
745
- await pushGame(meta.sshUrl, log);
746
+ pushed = await pushGame(meta.sshUrl, log);
746
747
  }
747
748
  log.step("Publishing to the gallery\u2026");
748
749
  let res;
@@ -766,10 +767,17 @@ async function runPublish(opts) {
766
767
  return;
767
768
  }
768
769
  log.plain("");
769
- log.success("Published. \u{1F389}");
770
+ if (pushed === false) {
771
+ log.warn(
772
+ "Listed in the gallery, but the game wasn't pushed \u2014 the play URL won't work until the push succeeds."
773
+ );
774
+ log.dim(" Fix the push error above and re-run `genex publish`.");
775
+ } else {
776
+ log.success("Published. \u{1F389}");
777
+ }
770
778
  if (meta.playUrl) {
771
779
  log.dim(` play: ${meta.playUrl}`);
772
- log.dim(" (GitHub Pages rebuilds ~30\u201390s after a push.)");
780
+ if (pushed === true) log.dim(" (GitHub Pages rebuilds ~30\u201390s after a push.)");
773
781
  }
774
782
  }
775
783
  async function pushGame(sshUrl, log) {
@@ -782,8 +790,8 @@ async function pushGame(sshUrl, log) {
782
790
  if (!isRepo) {
783
791
  log.step("Initializing git\u2026");
784
792
  if ((await run("git", ["init"])).code !== 0) {
785
- log.warn("git init failed \u2014 skipping push (use `genex publish --no-push` to silence).");
786
- return;
793
+ log.warn("git init failed \u2014 the game was not pushed (use `genex publish --no-push` to silence).");
794
+ return false;
787
795
  }
788
796
  }
789
797
  await run("git", ["add", "-A"]);
@@ -792,16 +800,17 @@ async function pushGame(sshUrl, log) {
792
800
  log.dim(" (no new commit to push)");
793
801
  }
794
802
  log.step("Pushing your game over SSH\u2026");
795
- const push = await run("git", ["push", sshUrl, "HEAD:main"], {
803
+ const push = await run("git", ["push", sshUrl, "+HEAD:main"], {
796
804
  GIT_SSH_COMMAND: `ssh -i ./${KEY_NAME} -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new`
797
805
  });
798
806
  if (push.code === 0) {
799
807
  log.success("Pushed to main.");
800
- } else {
801
- log.warn("git push didn't succeed (expected locally \u2014 the mock provider has no real repo).");
802
- const tail = push.err.trim().split("\n").slice(-1)[0];
803
- if (tail) log.dim(` ${tail}`);
808
+ return true;
804
809
  }
810
+ log.warn("git push failed \u2014 your live game was NOT updated.");
811
+ const tail = push.err.trim().split("\n").slice(-2).join(" ");
812
+ if (tail) log.dim(` ${tail}`);
813
+ return false;
805
814
  }
806
815
 
807
816
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genex-ai/cli-demo",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Set up your ~/.claude workspace, authorize, create a game project, and publish (genex CLI).",
5
5
  "type": "module",
6
6
  "bin": {