@lazycatcloud/lzc-cli 1.2.35 → 1.2.36
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.
|
@@ -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}`
|