improve token management for headless sync cli

This commit is contained in:
Nystik
2026-05-17 22:11:17 +02:00
parent 43778d7bca
commit 23306ff68e
3 changed files with 52 additions and 12 deletions

View File

@@ -29,6 +29,10 @@ module.exports = {
ctx.log("ob CLI not found. Install obsidian-headless to enable sync.");
}
// Redirect ob's HOME under the plugin's data dir so its config (per-vault sync setups, etc.)
// survives container recreates. Must happen before auth.loadToken since loadToken pushes the token into ob's config location via syncToObCli.
obCli.configure({ dataDir: ctx.dataDir });
const token = auth.loadToken(ctx.dataDir);
if (token) {