@getmonoceros/workbench 1.11.9 → 1.11.11

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/bin.js CHANGED
@@ -667,9 +667,7 @@ var realGitCredentialFill = (input) => {
667
667
  stdio: ["pipe", "pipe", "inherit"],
668
668
  env: {
669
669
  ...process.env,
670
- GIT_TERMINAL_PROMPT: "0",
671
- GIT_ASKPASS: "",
672
- SSH_ASKPASS: ""
670
+ GIT_TERMINAL_PROMPT: "0"
673
671
  }
674
672
  });
675
673
  let stdout = "";
@@ -682,6 +680,21 @@ var realGitCredentialFill = (input) => {
682
680
  child.stdin.end();
683
681
  });
684
682
  };
683
+ var realGitCredentialApprove = (input) => {
684
+ return new Promise((resolve, reject) => {
685
+ const child = spawn("git", ["credential", "approve"], {
686
+ stdio: ["pipe", "ignore", "inherit"],
687
+ env: {
688
+ ...process.env,
689
+ GIT_TERMINAL_PROMPT: "0"
690
+ }
691
+ });
692
+ child.on("error", reject);
693
+ child.on("exit", () => resolve());
694
+ child.stdin.write(input);
695
+ child.stdin.end();
696
+ });
697
+ };
685
698
  function resolveProvider(host, explicit) {
686
699
  const canonical = KNOWN_PROVIDER_HOSTS[host.toLowerCase()];
687
700
  if (canonical) return canonical;
@@ -702,14 +715,22 @@ function uniqueHttpsHosts(repos) {
702
715
  }
703
716
  return [...byHost.values()];
704
717
  }
718
+ var BREW_INSTALL_COMMAND = '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"';
705
719
  function installCommandForOS(opts) {
720
+ const withBrewBootstrap = (cmd) => [
721
+ "",
722
+ cyan(BREW_INSTALL_COMMAND),
723
+ cyan(cmd),
724
+ "",
725
+ dim("(Skip the first line if you already have Homebrew.)")
726
+ ].join("\n");
706
727
  switch (process.platform) {
707
728
  case "darwin":
708
- return cyan(opts.brew);
729
+ return withBrewBootstrap(opts.brew);
709
730
  case "win32":
710
- return cyan(opts.winget);
731
+ return ["", cyan(opts.winget)].join("\n");
711
732
  default:
712
- if (opts.linuxBrew) return cyan(opts.linuxBrew);
733
+ if (opts.linuxBrew) return withBrewBootstrap(opts.linuxBrew);
713
734
  return `See ${opts.linuxDocsUrl} for package instructions.`;
714
735
  }
715
736
  }
@@ -834,6 +855,7 @@ async function collectGitCredentials(devContainerRoot, hosts, options = {}) {
834
855
  const credsDir = path2.join(devContainerRoot, ".monoceros");
835
856
  const credentialsPath = path2.join(credsDir, "git-credentials");
836
857
  const spawnFn = options.spawn ?? realGitCredentialFill;
858
+ const approveFn = options.approve ?? realGitCredentialApprove;
837
859
  const logger = options.logger ?? { info: () => {
838
860
  }, warn: () => {
839
861
  } };
@@ -884,6 +906,16 @@ host=${host}
884
906
  }
885
907
  lines.push(formatCredentialLine(host, username, password));
886
908
  perHost.push({ host, provider, status: "ok", detail: "" });
909
+ const approveInput = `protocol=https
910
+ host=${host}
911
+ username=${username}
912
+ password=${password}
913
+
914
+ `;
915
+ try {
916
+ await approveFn(approveInput);
917
+ } catch {
918
+ }
887
919
  }
888
920
  await fs2.mkdir(credsDir, { recursive: true });
889
921
  await fs2.writeFile(
@@ -4154,9 +4186,7 @@ var realGitLsRemote = (url) => {
4154
4186
  stdio: ["ignore", "pipe", "pipe"],
4155
4187
  env: {
4156
4188
  ...process.env,
4157
- GIT_TERMINAL_PROMPT: "0",
4158
- GIT_ASKPASS: "",
4159
- SSH_ASKPASS: ""
4189
+ GIT_TERMINAL_PROMPT: "0"
4160
4190
  }
4161
4191
  });
4162
4192
  let stdout = "";
@@ -4785,7 +4815,7 @@ async function persistPromptedIdentity(prompted, ymlPath, home, logger) {
4785
4815
  }
4786
4816
 
4787
4817
  // src/version.ts
4788
- var CLI_VERSION = true ? "1.11.9" : "dev";
4818
+ var CLI_VERSION = true ? "1.11.11" : "dev";
4789
4819
 
4790
4820
  // src/commands/_dispatch.ts
4791
4821
  import { consola as consola12 } from "consola";