HarperFast / HarperFast/harper

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

Open
#672 0 comments 0 reactions 0 assignees View on GitHub
area:cli bug from-jira
Dominant language
JavaScript
Stars
89
Forks
10
Avg merge
2d 6h
Merged PRs (30d)
200

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.