@mutmutco/hub 4.1.5 → 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.
- package/dist/index.cjs +7 -5
- 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
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
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