pinokiod 3.2.158 → 3.2.160
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/kernel/shell.js +6 -1
- package/package.json +1 -1
package/kernel/shell.js
CHANGED
|
@@ -8,7 +8,8 @@ const { v4: uuidv4 } = require('uuid');
|
|
|
8
8
|
const os = require('os');
|
|
9
9
|
const fs = require('fs');
|
|
10
10
|
//const pty = require('node-pty-prebuilt-multiarch-cp');
|
|
11
|
-
const pty = require('@cocktailpeanut/node-pty-prebuilt-multiarch')
|
|
11
|
+
//const pty = require('@cocktailpeanut/node-pty-prebuilt-multiarch')
|
|
12
|
+
const pty = require('@homebridge/node-pty-prebuilt-multiarch')
|
|
12
13
|
const path = require("path")
|
|
13
14
|
const sudo = require("sudo-prompt-programfiles-x86");
|
|
14
15
|
const unparse = require('yargs-unparser-custom-flag');
|
|
@@ -719,6 +720,7 @@ class Shell {
|
|
|
719
720
|
}
|
|
720
721
|
}
|
|
721
722
|
kill(message, force) {
|
|
723
|
+
console.log("> KILL", { message, force })
|
|
722
724
|
|
|
723
725
|
this.done = true
|
|
724
726
|
this.ready = false
|
|
@@ -826,6 +828,7 @@ ${cleaned}
|
|
|
826
828
|
|
|
827
829
|
}
|
|
828
830
|
stream(msg, callback) {
|
|
831
|
+
console.log("# STREAM", msg)
|
|
829
832
|
this.vt.write(msg, () => {
|
|
830
833
|
let buf = this.vts.serialize()
|
|
831
834
|
let cleaned = this.stripAnsi(buf)
|
|
@@ -843,11 +846,13 @@ ${cleaned}
|
|
|
843
846
|
let termination_prompt_re = new RegExp(this.prompt_pattern + "[ \r\n]*$", "g")
|
|
844
847
|
let line = cleaned.replaceAll(/[\r\n]/g, "")
|
|
845
848
|
let test = line.match(termination_prompt_re)
|
|
849
|
+
console.log({ line, test, termination_prompt_re })
|
|
846
850
|
if (test) {
|
|
847
851
|
let cache = cleaned
|
|
848
852
|
let cached_msg = msg
|
|
849
853
|
// todo: may need to handle cases when the command returns immediately with no output (example: 'which brew' returns immediately with no text if brew doesn't exist)
|
|
850
854
|
setTimeout(() => {
|
|
855
|
+
console.log({ cache, cleaned })
|
|
851
856
|
if (cache === cleaned) {
|
|
852
857
|
if (this.persistent) {
|
|
853
858
|
if (this.cb) this.cb({
|