OverviewFilesCommitsIssuesDocsReleasesPeers

hyperident commits / 14832ea

FileManager.setBasePath: allow overriding default vault path
Adds setBasePath(customPath) to opt out of ~/.hyperident/ when needed (testing, non-default vault locations). Default behavior unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
14832eae2622fc6e594a38cc25c555002ae7ed96
by plankatron <fleeky@gmail.com> · 2026-04-17T02:41:59.000Z

Changed files (1) +11 -1

lib/file-ops.js +11 -1
……@@ -152,10 +152,20 @@ export class FileManager {
152152 }
153153
154154 /**
155 * Get the ~/.hyperident/ directory path cross-platform
155 * Override the default vault path. Call before any identity operations.
156 * @param {string} customPath - absolute path to use instead of ~/.hyperident
157 */
158 static setBasePath(customPath) {
159 FileManager._customPath = customPath
160 }
161
162 /**
163 * Get the hyperident directory path.
164 * Returns custom path if set via setBasePath(), otherwise ~/.hyperident/
156165 * @returns {string} Full path to hyperident directory
157166 */
158167 static getHyperidentPath() {
168 if (FileManager._customPath) return FileManager._customPath
159169 const homeDir = os.homedir()
160170 return path.join(homeDir, '.hyperident')
161171 }