@fluid-app/fluid-cli-mist 0.1.51 → 0.1.52

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/index.mjs CHANGED
@@ -4368,11 +4368,11 @@ const stagingWaitCommand = new Command("wait").description("Follow a staging ope
4368
4368
  //#endregion
4369
4369
  //#region src/commands/staging/request.ts
4370
4370
  /** `fluid mist staging request` — request staging at a revision. */
4371
- const stagingRequestCommand = new Command("request").description("Request the staging environment at a pushed commit").argument("[slug]", "The mist slug (defaults to .mist file in CWD)").option("--revision <sha>", "Full commit SHA to stage (defaults to this checkout's HEAD when it is clean and on main)").option("--operation-key <key>", "Resume an interrupted request with the key and --revision it printed").option("--wait", "Follow the operation until staging is ready").option("--timeout <minutes>", "How long --wait follows it (default 30)").option("--json", "Emit the operation as JSON").action((slug, opts) => runAction(async () => {
4371
+ const stagingRequestCommand = new Command("request").description("Request the staging environment at a pushed commit").argument("[slug]", "The mist slug (defaults to .mist file in CWD)").option("--revision <sha>", "Full commit SHA to stage (defaults to this checkout's HEAD when it is clean and on main)").option("--operation-key <key>", "Resume an interrupted request with the key and --revision it printed").option("--dir <path>", "Checkout to stage from when --revision is omitted (defaults to the current directory)").option("--wait", "Follow the operation until staging is ready").option("--timeout <minutes>", "How long --wait follows it (default 30)").option("--json", "Emit the operation as JSON").action((slug, opts) => runAction(async () => {
4372
4372
  if (opts.operationKey && !opts.revision) throw new Error("--operation-key needs the --revision it was first sent with. The interrupted request printed both.");
4373
4373
  const resolved = resolveSlug(slug);
4374
4374
  const client = createMistClient();
4375
- const sourceRevision = opts.revision ?? await localRevision(client, resolved);
4375
+ const sourceRevision = opts.revision ?? await localRevision(client, resolved, opts.dir ?? process.cwd());
4376
4376
  let operation = await requestStagingResumably(client, resolved, {
4377
4377
  sourceRevision,
4378
4378
  operationKey: opts.operationKey,
@@ -4386,10 +4386,10 @@ const stagingRequestCommand = new Command("request").description("Request the st
4386
4386
  if (operation.state === "succeeded") console.log(`✔ Staging is ready. Run \`fluid mist staging status\` for its URL.`);
4387
4387
  else console.log(`Requested. Follow it with \`fluid mist staging wait --operation ${operation.id}\`.`);
4388
4388
  }));
4389
- /** This checkout's HEAD, once it is clean and already on the remote's main. */
4390
- async function localRevision(client, slug) {
4389
+ /** The checkout's HEAD, once it is clean and already on the remote's main. */
4390
+ async function localRevision(client, slug, checkout) {
4391
4391
  const { git_credential: credential } = await createGitCredential(client, slug);
4392
- const revision = await resolveLocalStagingRevision(process.cwd(), credential.remote_url);
4392
+ const revision = await resolveLocalStagingRevision(checkout, credential.remote_url);
4393
4393
  process.stderr.write(chalk.dim(`Staging this checkout's HEAD, ${revision.slice(0, 7)}.\n`));
4394
4394
  return revision;
4395
4395
  }