@lazycatcloud/lzc-cli 1.2.35 → 1.2.37

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.
@@ -16,8 +16,6 @@ import { LpkManifest } from "./lpk_create.js"
16
16
  import archiver from "archiver"
17
17
  import yaml from "js-yaml"
18
18
 
19
- const isMacos = process.platform == "darwin"
20
-
21
19
  async function archiveFolderTo(appDir, out, format = "zip") {
22
20
  return new Promise(async (resolve, reject) => {
23
21
  if (!fs.existsSync(appDir)) {
@@ -81,7 +79,7 @@ function localIp() {
81
79
  const regex = /inet6 (fc03:1136:[0-9a-fA-F:]+)[?:\/ ]/
82
80
 
83
81
  let output = ""
84
- if (isMacos) {
82
+ if (process.platform == "darwin") {
85
83
  const result = spawnSync("sh", ["-c", "ifconfig"], {
86
84
  encoding: "utf-8"
87
85
  })
@@ -90,6 +88,9 @@ function localIp() {
90
88
  return ""
91
89
  }
92
90
  output = result.stdout
91
+ } else if (process.platform == "win32") {
92
+ logger.debug(`当前 Windows 不支持使用 LocalIP 反代`)
93
+ return ""
93
94
  } else {
94
95
  const result = spawnSync("ip", ["addr", "show", "heiyu-0"], {
95
96
  encoding: "utf-8"
@@ -3,6 +3,7 @@ import fs from "node:fs"
3
3
  import shellApi from "../shellapi.js"
4
4
  import { isDebugMode, resolveDomain, sleep, sshCmd } from "../utils.js"
5
5
  import logger from "loglevel"
6
+ import commandExists from "command-exists"
6
7
 
7
8
  export class DebugBridge {
8
9
  constructor() {
@@ -63,6 +64,13 @@ export class DebugBridge {
63
64
  }
64
65
 
65
66
  async sshCopyId() {
67
+ // 检查rsync工具是否存在:提示用户
68
+ const existed = commandExists.sync("ssh-copy-id")
69
+ if (!existed) {
70
+ logger.error("请检查 ssh-copy-id 是否安装,路径是否正确!")
71
+ process.exit(1)
72
+ }
73
+
66
74
  const resolvedIp = await resolveDomain(this.domain)
67
75
  return this.common(`ssh-copy-id`, [
68
76
  `-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -f -p 22222 box@${resolvedIp}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazycatcloud/lzc-cli",
3
- "version": "1.2.35",
3
+ "version": "1.2.37",
4
4
  "description": "lazycat cloud developer kit",
5
5
  "files": [
6
6
  "template",