({ vaultRoot, bind, serverBinary, configPath, disablePersistedMetaCache })
| 249 | } |
| 250 | |
| 251 | function startGoServer({ vaultRoot, bind, serverBinary, configPath, disablePersistedMetaCache }) { |
| 252 | const env = { |
| 253 | ...process.env, |
| 254 | ZENNOTES_BIND: bind, |
| 255 | ZENNOTES_CONFIG_PATH: configPath, |
| 256 | ZENNOTES_VAULT_PATH: vaultRoot, |
| 257 | ZENNOTES_ALLOW_INSECURE_NOAUTH: '1', |
| 258 | ...(disablePersistedMetaCache ? { ZEN_PERF_DISABLE_PERSISTED_META_CACHE: '1' } : {}) |
| 259 | } |
| 260 | const child = spawn(serverBinary, [], { |
| 261 | cwd: serverRoot, |
| 262 | env, |
| 263 | stdio: ['ignore', 'pipe', 'pipe'] |
| 264 | }) |
| 265 | let log = '' |
| 266 | child.stdout.on('data', (chunk) => { |
| 267 | log = appendBounded(log, chunk) |
| 268 | }) |
| 269 | child.stderr.on('data', (chunk) => { |
| 270 | log = appendBounded(log, chunk) |
| 271 | }) |
| 272 | return { |
| 273 | child, |
| 274 | log: () => log |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | function findChromePath() { |
| 279 | const candidates = [ |
no test coverage detected