pinokiod 3.19.73 → 3.19.76

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.
Files changed (2) hide show
  1. package/kernel/bin/cli.js +10 -7
  2. package/package.json +1 -1
package/kernel/bin/cli.js CHANGED
@@ -1,7 +1,8 @@
1
1
  const path = require('path')
2
+ const semver = require('semver')
2
3
  const Util = require('../util')
3
4
  class CLI {
4
- version = "0.0.8"
5
+ version = ">=0.0.10"
5
6
  async install(req, ondata) {
6
7
  await this.kernel.exec({
7
8
  message: "npm install -g pterm@latest --force",
@@ -13,21 +14,23 @@ class CLI {
13
14
  let exists
14
15
  console.log("platform", this.kernel.platform)
15
16
  if (this.kernel.platform === "win32") {
16
- exists = await Util.exists(this.kernel.path("bin/npm/pinokio"))
17
+ exists = await Util.exists(this.kernel.path("bin/npm/pterm"))
17
18
  console.log("Exists", exists)
18
19
  } else {
19
- exists = await Util.exists(this.kernel.path("bin/npm/bin/pinokio"))
20
+ exists = await Util.exists(this.kernel.path("bin/npm/bin/pterm"))
20
21
  console.log("Exists", exists)
21
22
  }
22
23
 
23
24
  if (exists) {
24
- let p = this.kernel.which("pinokio")
25
+ let p = this.kernel.which("pterm")
25
26
  if (p) {
26
27
  let res = await this.kernel.exec({
27
- message: "pinokio version terminal"
28
+ message: "pterm version terminal"
28
29
  }, ondata)
29
- let re = new RegExp(`.*pterm@${this.version}.*`)
30
- if (res.stdout && re.test(res.stdout)) {
30
+ let v = res.stdout.replace("pterm@", "")
31
+ let coerced = semver.coerce(v)
32
+ console.log({ v, coerced })
33
+ if (semver.satisfies(coerced, this.version)) {
31
34
  console.log("Installed")
32
35
  return true
33
36
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.19.73",
3
+ "version": "3.19.76",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {