pinokiod 2.15.57 → 2.15.59
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 +8 -4
- 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,18 @@ 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
440
|
// raw string -> do not touch
|
|
443
|
-
|
|
441
|
+
if (this.platform === "win32") {
|
|
442
|
+
delimiter = " & ";
|
|
443
|
+
} else {
|
|
444
|
+
delimiter = " ; ";
|
|
445
|
+
}
|
|
446
|
+
let m = params.message + delimiter + `echo "FINISHED: ${params.message}"\r\n`
|
|
447
|
+
return m
|
|
444
448
|
} else if (Array.isArray(params.message)) {
|
|
449
|
+
params.message.push(`echo "SHELL FINISHED RUNNING"\r\n`)
|
|
445
450
|
// if params.message is empty, filter out
|
|
446
451
|
//let delimiter = " && "
|
|
447
452
|
let delimiter
|
|
@@ -646,7 +651,6 @@ class Shell {
|
|
|
646
651
|
}
|
|
647
652
|
async exec(params) {
|
|
648
653
|
params = await this.activate(params)
|
|
649
|
-
|
|
650
654
|
this.cmd = this.build(params)
|
|
651
655
|
let res = await new Promise((resolve, reject) => {
|
|
652
656
|
this.resolve = resolve
|
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
|
}
|