@atlashub/smartstack-cli 4.63.0 → 4.64.0

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.js CHANGED
@@ -127451,6 +127451,23 @@ function getInstallCmd(pm, info) {
127451
127451
  if (!pm) return void 0;
127452
127452
  return info[pm];
127453
127453
  }
127454
+ function resolvePodmanCmd() {
127455
+ try {
127456
+ (0, import_child_process8.execSync)("podman --version", { encoding: "utf-8", timeout: 5e3, stdio: "pipe" });
127457
+ return "podman";
127458
+ } catch {
127459
+ }
127460
+ if (process.platform === "win32") {
127461
+ const knownPaths = [
127462
+ "C:\\Program Files\\RedHat\\Podman\\podman.exe",
127463
+ (0, import_path13.join)(process.env.LOCALAPPDATA || "", "RedHat", "Podman", "podman.exe")
127464
+ ];
127465
+ for (const p of knownPaths) {
127466
+ if (require("fs").existsSync(p)) return `"${p}"`;
127467
+ }
127468
+ }
127469
+ return "podman";
127470
+ }
127454
127471
  function getContainerEngineStatus() {
127455
127472
  try {
127456
127473
  const dockerVer = (0, import_child_process8.execSync)("docker --version", { encoding: "utf-8", timeout: 5e3, stdio: "pipe" }).trim();
@@ -127466,7 +127483,8 @@ function getContainerEngineStatus() {
127466
127483
  } catch {
127467
127484
  }
127468
127485
  try {
127469
- const podmanVer = (0, import_child_process8.execSync)("podman --version", { encoding: "utf-8", timeout: 5e3, stdio: "pipe" }).trim();
127486
+ const podmanCmd = resolvePodmanCmd();
127487
+ const podmanVer = (0, import_child_process8.execSync)(`${podmanCmd} --version`, { encoding: "utf-8", timeout: 5e3, stdio: "pipe" }).trim();
127470
127488
  return { name: "Podman", version: podmanVer.replace("podman version ", ""), running: true };
127471
127489
  } catch {
127472
127490
  }
@@ -127679,7 +127697,8 @@ var doctorCommand = new Command("doctor").description("Run diagnostics and check
127679
127697
  status: server.installed ? "ok" : "error",
127680
127698
  message: server.installed ? "Available" : "Not installed",
127681
127699
  details: server.description,
127682
- fix: !server.installed ? server.installCommand : void 0
127700
+ fix: !server.installed ? server.installCommand : void 0,
127701
+ installCmd: !server.installed ? server.installCommand : void 0
127683
127702
  });
127684
127703
  }
127685
127704
  } else {
@@ -127826,8 +127845,17 @@ ${source_default.gray(item.details)}`;
127826
127845
  (0, import_child_process8.execSync)(item.installCmd, { encoding: "utf-8", stdio: "inherit", timeout: 3e5 });
127827
127846
  console.log(` ${source_default.green("\u2713")} ${item.name} installed`);
127828
127847
  fixed++;
127829
- } catch {
127830
- console.log(` ${source_default.red("\u2717")} ${item.name} install failed \u2014 try manually: ${source_default.cyan(item.installCmd)}`);
127848
+ } catch (err) {
127849
+ const stderr = err.stderr || "";
127850
+ const stdout = err.stdout || "";
127851
+ const output = stderr + stdout;
127852
+ const alreadyInstalled = /already installed|déjà.*install|no applicable update|introuvable/i.test(output);
127853
+ if (alreadyInstalled) {
127854
+ console.log(` ${source_default.green("\u2713")} ${item.name} already installed (restart terminal if not detected)`);
127855
+ fixed++;
127856
+ } else {
127857
+ console.log(` ${source_default.red("\u2717")} ${item.name} install failed \u2014 try manually: ${source_default.cyan(item.installCmd)}`);
127858
+ }
127831
127859
  }
127832
127860
  console.log();
127833
127861
  }
@@ -130101,29 +130129,63 @@ tmuxCommand.command("status").description("Show WSL development environment stat
130101
130129
  var import_child_process12 = require("child_process");
130102
130130
  var import_path18 = require("path");
130103
130131
  var import_fs_extra16 = __toESM(require_lib());
130132
+ function resolveEngineCmd(name) {
130133
+ try {
130134
+ const result = (0, import_child_process12.spawnSync)(name, ["--version"], {
130135
+ encoding: "utf-8",
130136
+ shell: true,
130137
+ timeout: 5e3,
130138
+ stdio: "pipe"
130139
+ });
130140
+ if (result.status === 0) return name;
130141
+ } catch {
130142
+ }
130143
+ if (process.platform === "win32" && name === "podman") {
130144
+ const knownPaths = [
130145
+ "C:\\Program Files\\RedHat\\Podman\\podman.exe",
130146
+ (0, import_path18.join)(process.env.LOCALAPPDATA || "", "RedHat", "Podman", "podman.exe")
130147
+ ];
130148
+ for (const p of knownPaths) {
130149
+ if (import_fs_extra16.default.existsSync(p)) {
130150
+ try {
130151
+ const result = (0, import_child_process12.spawnSync)(`"${p}"`, ["--version"], {
130152
+ encoding: "utf-8",
130153
+ shell: true,
130154
+ timeout: 5e3,
130155
+ stdio: "pipe"
130156
+ });
130157
+ if (result.status === 0) return `"${p}"`;
130158
+ } catch {
130159
+ }
130160
+ }
130161
+ }
130162
+ }
130163
+ return name;
130164
+ }
130104
130165
  function checkEngine(name) {
130166
+ const cmd = resolveEngineCmd(name);
130105
130167
  try {
130106
- const version2 = (0, import_child_process12.spawnSync)(name, ["--version"], {
130168
+ const version2 = (0, import_child_process12.spawnSync)(cmd, ["--version"], {
130107
130169
  encoding: "utf-8",
130108
130170
  shell: true,
130109
130171
  timeout: 5e3,
130110
130172
  stdio: "pipe"
130111
130173
  });
130112
130174
  if (version2.status !== 0) {
130113
- return { name, installed: false, running: false };
130175
+ return { name, installed: false, running: false, cmd };
130114
130176
  }
130115
130177
  if (name === "podman") {
130116
- return { name, installed: true, running: true };
130178
+ return { name, installed: true, running: true, cmd };
130117
130179
  }
130118
- const info = (0, import_child_process12.spawnSync)(name, ["info"], {
130180
+ const info = (0, import_child_process12.spawnSync)(cmd, ["info"], {
130119
130181
  encoding: "utf-8",
130120
130182
  shell: true,
130121
130183
  timeout: 1e4,
130122
130184
  stdio: "pipe"
130123
130185
  });
130124
- return { name, installed: true, running: info.status === 0 };
130186
+ return { name, installed: true, running: info.status === 0, cmd };
130125
130187
  } catch {
130126
- return { name, installed: false, running: false };
130188
+ return { name, installed: false, running: false, cmd };
130127
130189
  }
130128
130190
  }
130129
130191
  function detectEngine() {
@@ -130174,7 +130236,7 @@ function requireComposeFile() {
130174
130236
  return composePath;
130175
130237
  }
130176
130238
  function runCompose(engine, composePath, args) {
130177
- const result = (0, import_child_process12.spawnSync)(engine.name, ["compose", "-f", composePath, ...args], {
130239
+ const result = (0, import_child_process12.spawnSync)(engine.cmd, ["compose", "-f", composePath, ...args], {
130178
130240
  encoding: "utf-8",
130179
130241
  shell: true,
130180
130242
  stdio: "inherit",