@mutmutco/hub 4.1.6 → 4.1.7

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.cjs +7 -5
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1883,13 +1883,15 @@ function message2(error) {
1883
1883
  return String(error?.message ?? error).replace(/\s+/g, " ").slice(0, 200);
1884
1884
  }
1885
1885
  var HERMES_PROCESS_SEGMENT = /^hermes(-cli|-code)?(\.(exe|cmd|bat|ps1|js|mjs|cjs|py))?$/i;
1886
+ var HUB_UPDATE_COMMAND = /(?:\bmmi-hub(?:\.(?:cmd|exe|bat|ps1))?\b|@mutmutco[/\\]hub[/\\]dist[/\\]index\.(?:cjs|mjs|js))[\s'"]+update\b/i;
1886
1887
  function hermesProcessToken(line, home) {
1887
1888
  const normalized = line.replace(/["']/g, " ");
1888
- if (home && normalized.toLowerCase().includes(home.toLowerCase())) return home;
1889
- for (const token of normalized.split(/\s+/)) {
1890
- if (token && token.split(/[/\\]/).some((segment) => HERMES_PROCESS_SEGMENT.test(segment))) return token;
1891
- }
1892
- return null;
1889
+ const tokens = normalized.split(/\s+/);
1890
+ const hermesToken = (candidates) => candidates.find((token) => token && token.split(/[/\\]/).some((segment) => HERMES_PROCESS_SEGMENT.test(segment))) ?? null;
1891
+ const direct = hermesToken(tokens.slice(0, 2));
1892
+ if (direct) return direct;
1893
+ if (HUB_UPDATE_COMMAND.test(line)) return null;
1894
+ return hermesToken(tokens) ?? (home && normalized.toLowerCase().includes(home.toLowerCase()) ? home : null);
1893
1895
  }
1894
1896
  function realProcessListing() {
1895
1897
  const result = process.platform === "win32" ? (0, import_node_child_process9.spawnSync)("powershell.exe", ["-NoProfile", "-Command", "Get-CimInstance Win32_Process | ForEach-Object { $_.Name + ' ' + $_.CommandLine }"], { encoding: "utf8", windowsHide: true, timeout: 15e3 }) : (0, import_node_child_process9.spawnSync)("ps", ["-eo", "args="], { encoding: "utf8", windowsHide: true, timeout: 15e3 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/hub",
3
- "version": "4.1.6",
3
+ "version": "4.1.7",
4
4
  "description": "Install and maintain the MMI CLI and every present host surface from one release-gated Hub command.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",