@lazycatcloud/lzc-cli 1.3.4 → 1.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/changelog.md +4 -0
- package/lib/utils.js +3 -14
- package/package.json +1 -1
- package/template/_lpk/manifest.yml.in +0 -2
- package/template/blank/lzc-manifest.yml +0 -1
package/changelog.md
CHANGED
package/lib/utils.js
CHANGED
|
@@ -579,22 +579,12 @@ export function findSshPublicKey() {
|
|
|
579
579
|
throw error
|
|
580
580
|
}
|
|
581
581
|
|
|
582
|
-
// 定义公钥优先级列表
|
|
583
|
-
const priorityKeys = [
|
|
584
|
-
"id_ed25519.pub",
|
|
585
|
-
"id_rsa.pub",
|
|
586
|
-
"id_ecdsa.pub",
|
|
587
|
-
"id_dsa.pub"
|
|
588
|
-
]
|
|
589
|
-
|
|
590
582
|
let avaiableKeys = []
|
|
591
583
|
try {
|
|
592
584
|
// 获取 .ssh 目录下所有文件
|
|
593
585
|
const files = fs.readdirSync(sshDir)
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
for (const keyName of priorityKeys) {
|
|
597
|
-
if (files.includes(keyName)) {
|
|
586
|
+
files.forEach((keyName) => {
|
|
587
|
+
if (keyName.endsWith(".pub")) {
|
|
598
588
|
const keyPath = path.join(sshDir, keyName)
|
|
599
589
|
// 验证文件是否可读
|
|
600
590
|
try {
|
|
@@ -605,10 +595,9 @@ export function findSshPublicKey() {
|
|
|
605
595
|
})
|
|
606
596
|
} catch (error) {
|
|
607
597
|
console.warn(`Found ${keyName} but cannot read it:`, error.message)
|
|
608
|
-
continue
|
|
609
598
|
}
|
|
610
599
|
}
|
|
611
|
-
}
|
|
600
|
+
})
|
|
612
601
|
|
|
613
602
|
if (avaiableKeys.length == 0) {
|
|
614
603
|
throw new Error(
|
package/package.json
CHANGED