You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internal/devconfig: move project directory search into devbox.Find (#2172)
Some cleanup when I looked into supporting different config extensions
(e.g., `devbox.jsonc` to make editors okay with comments).
Instead of first searching for a project directory and then calling
`devbox.Open` on that path, add a `devbox.Find` method that performs the
search and open as a single step.
- Add separate `Find` and `Open` functions to make it clearer when we're
recursively searching for a config vs. not.
- Try just reading files instead of performing a separate `os.Stat`.
- Fix a bug where specifying any filename other than `devbox.json` with
the `-C` flag would fail with a bad error message.
Changes to user error messages:
```diff
$ devbox add go
-Error: No devbox.json found in this directory, or any parent directories. Did you run `devbox init` yet?
+Error: no devbox.json found in the current directory (or any parent directories). Did you run `devbox init` yet?
$ devbox -c badpath add go
-Error: stat /var/folders/79/1yc1ywp10w9f2xnr_rpp_ff00000gn/T/tmp.bU25JVWovO/badpath: no such file or directory
+
+Error: the devbox config path "badpath" does not exist.
$ mkdir child
$ devbox -c child add go
-Error: No devbox.json found in child. Did you run `devbox init` yet?
+Error: no devbox.json found in "child". Did you run `devbox init` yet?
```
0 commit comments