pinokiod 2.15.57 → 2.15.60
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 +10 -5
- package/kernel/shells.js +0 -4
- package/package.json +1 -1
package/kernel/shell.js
CHANGED
|
@@ -341,7 +341,6 @@ class Shell {
|
|
|
341
341
|
return r
|
|
342
342
|
}
|
|
343
343
|
async request(params, cb) {
|
|
344
|
-
|
|
345
344
|
// create the path if it doesn't exist
|
|
346
345
|
await fs.promises.mkdir(params.path, { recursive: true }).catch((e) => { })
|
|
347
346
|
|
|
@@ -436,12 +435,19 @@ class Shell {
|
|
|
436
435
|
return new Promise(r=>fs.access(abspath, fs.constants.F_OK, e => r(!e)))
|
|
437
436
|
}
|
|
438
437
|
build (params) {
|
|
439
|
-
|
|
440
438
|
if (params.message) {
|
|
441
439
|
if (typeof params.message === "string") {
|
|
442
|
-
// raw string -> do not touch
|
|
443
440
|
return params.message
|
|
441
|
+
// // raw string -> do not touch
|
|
442
|
+
// if (this.platform === "win32") {
|
|
443
|
+
// delimiter = " & ";
|
|
444
|
+
// } else {
|
|
445
|
+
// delimiter = " ; ";
|
|
446
|
+
// }
|
|
447
|
+
// let m = params.message + delimiter + `echo "FINISHED: ${params.message}"\r\n`
|
|
448
|
+
// return m
|
|
444
449
|
} else if (Array.isArray(params.message)) {
|
|
450
|
+
// params.message.push(`echo "SHELL FINISHED RUNNING"\r\n`)
|
|
445
451
|
// if params.message is empty, filter out
|
|
446
452
|
//let delimiter = " && "
|
|
447
453
|
let delimiter
|
|
@@ -646,7 +652,6 @@ class Shell {
|
|
|
646
652
|
}
|
|
647
653
|
async exec(params) {
|
|
648
654
|
params = await this.activate(params)
|
|
649
|
-
|
|
650
655
|
this.cmd = this.build(params)
|
|
651
656
|
let res = await new Promise((resolve, reject) => {
|
|
652
657
|
this.resolve = resolve
|
|
@@ -848,7 +853,7 @@ ${cleaned}
|
|
|
848
853
|
} else {
|
|
849
854
|
//console.log("## more incoming... ignore")
|
|
850
855
|
}
|
|
851
|
-
},
|
|
856
|
+
}, 1000)
|
|
852
857
|
} else {
|
|
853
858
|
callback()
|
|
854
859
|
}
|
package/kernel/shells.js
CHANGED
|
@@ -56,22 +56,18 @@ class Shells {
|
|
|
56
56
|
// if array, duplicate the action
|
|
57
57
|
if (Array.isArray(params.message)) {
|
|
58
58
|
let res
|
|
59
|
-
console.log("Message Array", params.message)
|
|
60
59
|
for(let i=0; i<params.message.length; i++) {
|
|
61
60
|
let message = params.message[i]
|
|
62
61
|
let params_dup = Object.assign({}, params)
|
|
63
62
|
params_dup.message = message
|
|
64
|
-
console.log("Launching Message", params_dup)
|
|
65
63
|
res = await this._launch(params_dup, options, ondata)
|
|
66
64
|
// if there's an error, immediately return with the error
|
|
67
65
|
if (res.error) {
|
|
68
66
|
return res
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
|
-
console.log("Launch Message Array Finished", res)
|
|
72
69
|
return res
|
|
73
70
|
} else {
|
|
74
|
-
console.log("Single Message", params.message)
|
|
75
71
|
let res = await this._launch(params, options, ondata)
|
|
76
72
|
return res
|
|
77
73
|
}
|