pinokiod 3.19.72 → 3.19.74
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/bin/cli.js +5 -5
- package/kernel/index.js +7 -2
- package/package.json +1 -1
package/kernel/bin/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
2
|
const Util = require('../util')
|
|
3
3
|
class CLI {
|
|
4
|
-
version = "0.0.
|
|
4
|
+
version = "0.0.9"
|
|
5
5
|
async install(req, ondata) {
|
|
6
6
|
await this.kernel.exec({
|
|
7
7
|
message: "npm install -g pterm@latest --force",
|
|
@@ -13,18 +13,18 @@ class CLI {
|
|
|
13
13
|
let exists
|
|
14
14
|
console.log("platform", this.kernel.platform)
|
|
15
15
|
if (this.kernel.platform === "win32") {
|
|
16
|
-
exists = await Util.exists(this.kernel.path("bin/npm/
|
|
16
|
+
exists = await Util.exists(this.kernel.path("bin/npm/pterm"))
|
|
17
17
|
console.log("Exists", exists)
|
|
18
18
|
} else {
|
|
19
|
-
exists = await Util.exists(this.kernel.path("bin/npm/bin/
|
|
19
|
+
exists = await Util.exists(this.kernel.path("bin/npm/bin/pterm"))
|
|
20
20
|
console.log("Exists", exists)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
if (exists) {
|
|
24
|
-
let p = this.kernel.which("
|
|
24
|
+
let p = this.kernel.which("pterm")
|
|
25
25
|
if (p) {
|
|
26
26
|
let res = await this.kernel.exec({
|
|
27
|
-
message: "
|
|
27
|
+
message: "pterm version terminal"
|
|
28
28
|
}, ondata)
|
|
29
29
|
let re = new RegExp(`.*pterm@${this.version}.*`)
|
|
30
30
|
if (res.stdout && re.test(res.stdout)) {
|
package/kernel/index.js
CHANGED
|
@@ -613,8 +613,13 @@ class Kernel {
|
|
|
613
613
|
if (pattern) {
|
|
614
614
|
let match = null
|
|
615
615
|
for(let line of lines) {
|
|
616
|
-
|
|
617
|
-
if (
|
|
616
|
+
let matches = /^\/(.+)\/([dgimsuy]*)$/gs.exec(pattern)
|
|
617
|
+
if (!/g/.test(matches[2])) {
|
|
618
|
+
matches[2] += "g" // if g option is not included, include it (need it for matchAll)
|
|
619
|
+
}
|
|
620
|
+
let re = new RegExp(matches[1], matches[2])
|
|
621
|
+
console.log("testing", { line, pattern, re })
|
|
622
|
+
if (re.test(line)) {
|
|
618
623
|
match = line
|
|
619
624
|
console.log("matched", { line })
|
|
620
625
|
break
|