Skip to content

CLI install: tilde (~) path not expanded correctly for HarperDB destination #672

Description

@kriszyp

When the CLI install prompt asks "Please enter a destination for HarperDB:", entering a ~/... path is handled inconsistently:

  • Sometimes creates a literal ~ directory relative to cwd.
  • Sometimes tries to resolve it as an absolute home path but fails.
  • Only a leading / path reliably works.

Reproduction

Please enter a destination for HarperDB: ~/dev/hdb
# → installs successfully but then:
Error: ENOENT: no such file or directory, open '/Users/ethan/dev/hdb/harperdb-config.yaml'

The directory was installed to the correct location but ~/dev/hdb was not expanded consistently everywhere it was used — some code paths got the unexpanded string.

Fix

Resolve all user-supplied paths through path.resolve() / os.homedir() expansion immediately after input, before storing or using them anywhere.


🤖 Filed by Claude on behalf of Kris.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliCommand-line interface, bin/ scriptsbugSomething isn't workingfrom-jiraMigrated or originated from a Jira ticket

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions