This isn’t an elm-specific question, but it’s one that comes up while working with elm a lot for me.
Are there any tools that let you create a config file or something in a folder that makes it so that certain commands, if run from that folder, are automatically run in a different folder context?
To illustrate: I have a Phoenix app that uses Elm, and when I run, for example, npm install
, elm-json
, elm
commands, etc, etc, I have to be careful to remember to cd
into the /assets
folder where my elm.json
, package.json
, etc, stuff is, and then remember to cd
back out again to do anything else with the app. This results in a lot of frustrating “Oh I forgot where I was and now I have to go delete the random files this command just generated in the wrong place” moments. Using npm --prefix assets
is helpful for npm commands, but what I’d really like is a tool where I could write a configuration file that looks something like, say, this
npm: ./assets
elm: ./assets
elm-json: ./assets
and then put it in my project root, and then when I run any of those commands from the root, it automatically runs them as though they’re being run from the specified folder context (e.g. the assets
folder). Seems like this must be a common frustration, but it’s a hard type of tool to google for, so I figured I’d ask if anyone knows of something like this, or similar things, or ways around this that I haven’t thought of?