Skip to content

bug: normalizeDiaryPath does not expand ~ to home directory #201

@compoodment

Description

@compoodment

Summary

normalizeDiaryPath() uses path.resolve() on the raw configured path. path.resolve("~/dreams.md") resolves to <cwd>/~/dreams.md, not the user's home directory.

Impact

A natural Unix-style config value like dreamPromotionDiaryPath: "~/dreams.md" fails allowed-root validation with a confusing error.

Fix Path

PR #202 expands ~ to os.homedir() before resolving and applying allowed-root checks.

Verification Target

  • Unit test for ~/... diary path expansion.
  • Unit test proving allowed-root validation still rejects paths outside allowed roots after expansion.

– Vale

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