update ssh.ts

This commit is contained in:
2026-02-07 01:51:20 +08:00
parent 0a52ccc601
commit dceac24691
2 changed files with 7 additions and 8 deletions

View File

@@ -247,12 +247,12 @@
}, },
"ssh.ts": { "ssh.ts": {
"script_name": "ssh.ts", "script_name": "ssh.ts",
"script_length": 6648, "script_length": 6660,
"script_sha256": "c547c5319abaec8edbc3bcb875eaf623ea144a38da023319af208ea329d97622", "script_sha256": "c3ed11c0cbb3c407bf66302b209122138308cac8a57b2e41704ce1b1ca97ddb5",
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/ssh.ts", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/ssh.ts",
"single_script_file": true, "single_script_file": true,
"publish_time": 1768111677531, "publish_time": 1768111677531,
"update_time": 1770397497575 "update_time": 1770400275422
}, },
"tree.ts": { "tree.ts": {
"script_name": "tree.ts", "script_name": "tree.ts",

View File

@@ -85,10 +85,9 @@ function printSshConfig(sshConfig: SshConfig) {
} }
async function loadSshConfig(): SshConfig { async function loadSshConfig(): SshConfig {
const configFile = "~/.config/ssh-rs-config.json";
try { try {
const sshConfigText = await readFileToString( const sshConfigText = await readFileToString(configFile);
"~/.config/ssh-rs-config.json",
);
return JSON5.parse(sshConfigText); return JSON5.parse(sshConfigText);
} catch (e) { } catch (e) {
throw `Load config file: ${configFile} failed: ${e}`; throw `Load config file: ${configFile} failed: ${e}`;
@@ -202,5 +201,5 @@ async function main() {
} }
await main(); await main();
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260207T010448+08:00.MEUCIQDS26BFCGE2YCDYK64p // @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260207T015058+08:00.MEQCIE2aMMk7tBzsdVFKzz1n
// p54VTppFiq00bCcKvjL75VTgAwIgI6byeiHc41LGVHDscJ7cnmH+lP2qJxpXFqo7UmpUFDA= // JJ3kMRKyWFqLAITwrFJMX8nVAiAQ5VK424bNfJ6k+BH5gBWkSHfWYF3e6TkuZM/esu3Fiw==