@matterbridge/thread 3.9.2-dev-20260625-1591faa → 3.9.2-dev-20260625-a8359b3
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/spawnCommand.js +9 -4
- package/package.json +3 -3
package/dist/spawnCommand.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isBun } from '@matterbridge/utils/bun';
|
|
1
2
|
import { hasParameter } from '@matterbridge/utils/cli';
|
|
2
3
|
import { getErrorMessage } from '@matterbridge/utils/error';
|
|
3
4
|
import { logModuleLoaded } from '@matterbridge/utils/loader';
|
|
@@ -22,13 +23,17 @@ export async function spawnCommand(command, args, packageCommand, packageName) {
|
|
|
22
23
|
log.debug(`Spawning command: ${command} with ${args.join(' ')} ${packageCommand} ${packageName}`);
|
|
23
24
|
const cmdLine = command + ' ' + args.join(' ');
|
|
24
25
|
if (process.platform === 'win32' && command === 'npm') {
|
|
25
|
-
const argstring = 'npm ' + args.join(' ');
|
|
26
|
+
const argstring = isBun() ? 'bun ' + args.join(' ') : 'npm ' + args.join(' ');
|
|
26
27
|
args.splice(0, args.length, '/c', argstring);
|
|
27
28
|
command = 'cmd.exe';
|
|
28
29
|
}
|
|
29
30
|
if (hasParameter('sudo') ||
|
|
30
|
-
(process.platform !== 'win32' &&
|
|
31
|
-
|
|
31
|
+
(process.platform !== 'win32' &&
|
|
32
|
+
(command === 'npm' || command === 'bun') &&
|
|
33
|
+
!hasParameter('docker') &&
|
|
34
|
+
!hasParameter('nosudo') &&
|
|
35
|
+
!process.env.PATH?.includes('/.nvm/versions/node/'))) {
|
|
36
|
+
args.unshift(command === 'npm' && isBun() ? 'bun' : command);
|
|
32
37
|
command = 'sudo';
|
|
33
38
|
}
|
|
34
39
|
log.debug(`Spawn command ${command} with ${args.join(' ')}`);
|
|
@@ -37,7 +42,7 @@ export async function spawnCommand(command, args, packageCommand, packageName) {
|
|
|
37
42
|
sendLog('Matterbridge:spawn-init', `Installing ${packageName}`);
|
|
38
43
|
else if (packageCommand === 'uninstall')
|
|
39
44
|
sendLog('Matterbridge:spawn-init', `Uninstalling ${packageName}`);
|
|
40
|
-
const childProcess = spawn(command, args, {
|
|
45
|
+
const childProcess = spawn(command === 'npm' && isBun() ? 'bun' : command, args, {
|
|
41
46
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
42
47
|
});
|
|
43
48
|
childProcess.on('error', (err) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/thread",
|
|
3
|
-
"version": "3.9.2-dev-20260625-
|
|
3
|
+
"version": "3.9.2-dev-20260625-a8359b3",
|
|
4
4
|
"description": "Matterbridge thread library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"CHANGELOG.md"
|
|
70
70
|
],
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@matterbridge/types": "3.9.2-dev-20260625-
|
|
73
|
-
"@matterbridge/utils": "3.9.2-dev-20260625-
|
|
72
|
+
"@matterbridge/types": "3.9.2-dev-20260625-a8359b3",
|
|
73
|
+
"@matterbridge/utils": "3.9.2-dev-20260625-a8359b3",
|
|
74
74
|
"@zip.js/zip.js": "2.8.26",
|
|
75
75
|
"node-ansi-logger": "3.3.0"
|
|
76
76
|
}
|