pinokiod 3.3.4 → 3.3.5
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/playwright.js +28 -20
- package/kernel/index.js +2 -2
- package/package.json +1 -1
package/kernel/bin/playwright.js
CHANGED
|
@@ -7,11 +7,13 @@ class Playwright {
|
|
|
7
7
|
await rimraf(p)
|
|
8
8
|
await fs.promises.mkdir(p, { recursive: true }).catch((e) => { })
|
|
9
9
|
let cmd
|
|
10
|
+
let pwpath
|
|
10
11
|
if (this.kernel.platform === "linux") {
|
|
12
|
+
pwpath = this.kernel.bin.path("playwright/node_modules/playwright")
|
|
11
13
|
cmd = {
|
|
12
14
|
message: [
|
|
13
15
|
"npm init -y",
|
|
14
|
-
"npm install playwright@latest
|
|
16
|
+
"npm install playwright@latest",
|
|
15
17
|
//"npm install npm corepack playwright@1.49.1 --loglevel verbose",
|
|
16
18
|
//"npm install playwright --loglevel verbose",
|
|
17
19
|
//"playwright install firefox",
|
|
@@ -27,6 +29,7 @@ class Playwright {
|
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
} else {
|
|
32
|
+
pwpath = this.kernel.bin.path("playwright/js/node_modules/playwright")
|
|
30
33
|
cmd = {
|
|
31
34
|
message: [
|
|
32
35
|
"npm init -y playwright@latest -- --lang js --quiet --install-deps",
|
|
@@ -47,28 +50,33 @@ class Playwright {
|
|
|
47
50
|
}
|
|
48
51
|
await this.kernel.bin.exec(cmd, ondata)
|
|
49
52
|
console.log("INSTALL FINISHED")
|
|
50
|
-
let pwpath = this.kernel.bin.path("playwright/js/node_modules/playwright")
|
|
51
53
|
this.kernel.playwright = (await this.kernel.loader.load(pwpath)).resolved
|
|
52
54
|
}
|
|
53
55
|
async installed() {
|
|
54
|
-
let browsers = this.kernel.path("bin/playwright/browsers")
|
|
55
|
-
let e1 = await this.kernel.bin.exists(browsers)
|
|
56
|
-
let node_modules = this.kernel.path("bin/playwright/js/node_modules/playwright")
|
|
57
|
-
let e2 = await this.kernel.bin.exists(node_modules)
|
|
58
|
-
console.log({ e1, e2 })
|
|
59
|
-
return e1 && e2
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
56
|
+
//let browsers = this.kernel.path("bin/playwright/browsers")
|
|
57
|
+
//let e1 = await this.kernel.bin.exists(browsers)
|
|
58
|
+
//let node_modules = this.kernel.path("bin/playwright/js/node_modules/playwright")
|
|
59
|
+
//let e2 = await this.kernel.bin.exists(node_modules)
|
|
60
|
+
//console.log({ e1, e2 })
|
|
61
|
+
//return e1 && e2
|
|
62
|
+
if (this.kernel.platform === "linux") {
|
|
63
|
+
//let pwpath = this.kernel.path("bin/playwright")
|
|
64
|
+
//let e1 = await this.kernel.bin.exists(pwpath)
|
|
65
|
+
//return e1
|
|
66
|
+
let browsers = this.kernel.path("bin/playwright/browsers")
|
|
67
|
+
let e1 = await this.kernel.bin.exists(browsers)
|
|
68
|
+
let node_modules = this.kernel.path("bin/playwright/node_modules/playwright")
|
|
69
|
+
let e2 = await this.kernel.bin.exists(node_modules)
|
|
70
|
+
console.log({ e1, e2 })
|
|
71
|
+
return e1 && e2
|
|
72
|
+
} else {
|
|
73
|
+
let browsers = this.kernel.path("bin/playwright/browsers")
|
|
74
|
+
let e1 = await this.kernel.bin.exists(browsers)
|
|
75
|
+
let node_modules = this.kernel.path("bin/playwright/js/node_modules/playwright")
|
|
76
|
+
let e2 = await this.kernel.bin.exists(node_modules)
|
|
77
|
+
console.log({ e1, e2 })
|
|
78
|
+
return e1 && e2
|
|
79
|
+
}
|
|
72
80
|
}
|
|
73
81
|
async uninstall(req, ondata) {
|
|
74
82
|
ondata({ raw: "cleaning up\r\n" })
|
package/kernel/index.js
CHANGED
|
@@ -611,8 +611,8 @@ class Kernel {
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
let pwpath
|
|
614
|
-
if (this.platform === "
|
|
615
|
-
pwpath = this.bin.path("playwright/
|
|
614
|
+
if (this.platform === "linux") {
|
|
615
|
+
pwpath = this.bin.path("playwright/node_modules/playwright")
|
|
616
616
|
} else {
|
|
617
617
|
pwpath = this.bin.path("playwright/js/node_modules/playwright")
|
|
618
618
|
}
|