codify-plugin-lib 1.0.125 → 1.0.127
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import pty from '@homebridge/node-pty-prebuilt-multiarch';
|
|
1
2
|
import { nanoid } from 'nanoid';
|
|
2
3
|
import * as cp from 'node:child_process';
|
|
3
4
|
import { EventEmitter } from 'node:events';
|
|
4
5
|
import * as fs from 'node:fs/promises';
|
|
5
|
-
import pty from 'node-pty';
|
|
6
6
|
import stripAnsi from 'strip-ansi';
|
|
7
7
|
import { debugLog } from '../utils/debug.js';
|
|
8
8
|
import { SpawnError } from './index.js';
|
|
@@ -44,7 +44,6 @@ export class BackgroundPty {
|
|
|
44
44
|
});
|
|
45
45
|
return new Promise((resolve) => {
|
|
46
46
|
const cat = cp.spawn('cat', [`/tmp/${cid}`]);
|
|
47
|
-
cat.stdout.pipe(process.stdout);
|
|
48
47
|
let output = '';
|
|
49
48
|
cat.stdout.on('data', (data) => {
|
|
50
49
|
output += data.toString();
|
|
@@ -62,6 +61,9 @@ export class BackgroundPty {
|
|
|
62
61
|
data: strippedData,
|
|
63
62
|
});
|
|
64
63
|
}
|
|
64
|
+
else {
|
|
65
|
+
process.stdout.write(data);
|
|
66
|
+
}
|
|
65
67
|
});
|
|
66
68
|
this.promiseQueue.run(async () => new Promise((resolve) => {
|
|
67
69
|
const cdCommand = options?.cwd ? `cd ${options.cwd}; ` : '';
|
package/package.json
CHANGED
|
@@ -55,7 +55,6 @@ export class BackgroundPty implements IPty {
|
|
|
55
55
|
|
|
56
56
|
return new Promise<SpawnResult>((resolve) => {
|
|
57
57
|
const cat = cp.spawn('cat', [`/tmp/${cid}`])
|
|
58
|
-
cat.stdout.pipe(process.stdout);
|
|
59
58
|
|
|
60
59
|
let output = '';
|
|
61
60
|
cat.stdout.on('data', (data) => {
|
|
@@ -76,6 +75,8 @@ export class BackgroundPty implements IPty {
|
|
|
76
75
|
exitCode: Number.parseInt(exit ?? 1, 10),
|
|
77
76
|
data: strippedData,
|
|
78
77
|
});
|
|
78
|
+
} else {
|
|
79
|
+
process.stdout.write(data);
|
|
79
80
|
}
|
|
80
81
|
})
|
|
81
82
|
|