Closed dynajoe closed 7 years ago
It's worth noting that this behavior has precedent:
https://docs.npmjs.com/cli/prefix https://docs.npmjs.com/cli/bin
I agree. I actually came across this issue using elm-repl, but it affects all the cli tools. I was surprised that running the command in a sub-folder of a project tries to create a new project, rather than looking for a project in a parent folder first. As @joeandaverde says, this is how npm works.
Maybe there are cases where this is the desirable behaviour but I can't think of them. Most likely it would be done by accident.
It's annoying when using Elm in a Phoenix application. Maybe there's a way to just specify the path to the elmpackage.json in either package.json file or as a command line argument?
This is how things will work with any elm
command in the upcoming release. I will likely add a little note if you are not in the root though so there are no surprises.
elm-make
uses this library to determine whereelm-stuff
andelm-package.json
directories are.Should this library provide absolute paths relative to the nearest
elm-package.json
.This would greatly help knowing the root directory for a project when using
elm-make
and possibly reduce the times this issue occurs unintentionally:https://github.com/elm-lang/elm-make/issues/2