pinokiod 3.8.55 → 3.8.57

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.
@@ -15,7 +15,7 @@ class LocalhostVariableRouter extends Processor {
15
15
  let val = local_variables_for_script[key]
16
16
  if (val.startsWith("http")) {
17
17
  let dial = val.replace(/https?:\/\//, '')
18
- let name = this.api_name(this.router.kernel.homedir, script_path)
18
+ let name = this.api_name(this.router.kernel.platform, this.router.kernel.homedir, script_path)
19
19
  console.log({ dial, name, has_port: this.has_port(dial), parsed_dial: this.parse_ip(dial) })
20
20
  if (this.has_port(dial)) {
21
21
  if (key === "url") {
@@ -5,18 +5,22 @@ class Processor {
5
5
  return chunks.length === 2
6
6
  }
7
7
  api_name(platform, home, str) {
8
- let _path = path[platform]
8
+ console.log({ platform, home, str })
9
9
  let api_path
10
10
  let rel_path
11
11
  if (platform === 'win32') {
12
+ let _path = path.win32
12
13
  api_path = _path.resolve(home, "api")
13
14
  rel_path = _path.relative(api_path, str)
14
15
  } else {
16
+ let _path = path.posix
15
17
  api_path = _path.resolve(home, "api")
16
18
  rel_path = _path.relative(api_path, str)
17
19
  }
18
20
  console.log({ api_path, rel_path, })
19
- return rel_path.split(_path.sep)[0]
21
+ let name = rel_path.split(_path.sep)[0]
22
+ console.log({ name })
23
+ return name
20
24
  }
21
25
  parse_ip(str) {
22
26
  let chunks = str.split(":")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.8.55",
3
+ "version": "3.8.57",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {