(key: string, value: string)
| 195 | this.configPath = path.join( |
| 196 | createDirectoryInAssets("sshkey"), |
| 197 | "sshkey_config.json" |
| 198 | ); |
| 199 | this.db = await JSONFilePreset<Record<string, any>>( |
| 200 | this.configPath, |
| 201 | { ...DEFAULT_CONFIG } |
| 202 | ); |
| 203 | this.initialized = true; |
| 204 | } catch (error) { |
| 205 | console.error("[ssh] 初始化配置失败:", error); |
| 206 | } finally { |
| 207 | this.initLock = false; |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | static async get(key: string, defaultValue?: string): Promise<string> { |
no test coverage detected