(options)
| 253 | } |
| 254 | |
| 255 | async function linkHostKeychains(options) { |
| 256 | const realHome = process.env.HOME; |
| 257 | if (!realHome) return; |
| 258 | |
| 259 | const source = path.join(realHome, "Library", "Keychains"); |
| 260 | const destination = path.join(options.obsidianHome, "Library", "Keychains"); |
| 261 | try { |
| 262 | await fs.lstat(source); |
| 263 | } catch (error) { |
| 264 | if (error?.code === "ENOENT") return; |
| 265 | throw error; |
| 266 | } |
| 267 | |
| 268 | try { |
| 269 | const stat = await fs.lstat(destination); |
| 270 | if (!stat.isSymbolicLink()) return; |
| 271 | const target = await fs.readlink(destination); |
| 272 | if (path.resolve(path.dirname(destination), target) === source) return; |
| 273 | await fs.unlink(destination); |
| 274 | } catch (error) { |
| 275 | if (error?.code !== "ENOENT") throw error; |
| 276 | } |
| 277 | |
| 278 | await fs.mkdir(path.dirname(destination), { recursive: true }); |
| 279 | await fs.symlink(source, destination); |
| 280 | } |
| 281 | |
| 282 | function stableVaultId(vaultPath) { |
| 283 | return crypto |
no test coverage detected