Skip to content

fix: log directory not created automatically #44

@dwmkerr

Description

@dwmkerr

Summary

When using --log-path with a path in a non-existent directory, the server fails with:

Error: ENOENT: no such file or directory, open '/tmp/shellwright/log.jsonl'

Root Cause

In src/index.ts, fsSync.appendFileSync(LOG_PATH, ...) is called without ensuring the parent directory exists first.

Fix

Add directory creation before first log write:

if (LOG_PATH) {
  const logDir = path.dirname(LOG_PATH);
  fsSync.mkdirSync(logDir, { recursive: true });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions