From a247012168b13577301599336c3ca97922013095 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 25 Jan 2026 10:20:51 +0800 Subject: [PATCH] feat: update ssh.ts --- single-scripts/ssh.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/single-scripts/ssh.ts b/single-scripts/ssh.ts index d4043a6..bb97f38 100755 --- a/single-scripts/ssh.ts +++ b/single-scripts/ssh.ts @@ -7,6 +7,7 @@ import {parseArgs} from "node:util"; import fs from "node:fs"; import os from "node:os"; +import JSON5 from "json5"; // reference: https://bun.com/docs/runtime/color const GREEN = Bun.color("green", "ansi"); @@ -97,7 +98,7 @@ function loadSshConfig(): SshConfig { const configFile = os.homedir() + "/.config/ssh-rs-config.json"; try { const sshConfigText = fs.readFileSync(configFile, "utf8"); - return JSON.parse(sshConfigText); + return JSON5.parse(sshConfigText); } catch (e) { console.error(`Load config file: ${configFile} failed.`, e); } @@ -211,5 +212,5 @@ async function main() { } await main(); -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260123T010039+08:00.MEYCIQCiVexBU7NyQo5LWv5F -// /mzpbGJiduFHzzhEg/9FB5Y8ZQIhAN21S6dCoghgEJCS+MFZejEF2w7PUwSZMp2r92cUUGqO +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260125T102036+08:00.MEUCIQCn1lxyOA9IK2wnLoXD +// 6OjOe3m+V1ZZIwc461wTqQKmsgIgDdRvAsi2Dxvrk1bKXelGeboeO1J3aRdEB/FMPqsXS8Q=