Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a --root CLI argument #56

Merged
merged 2 commits into from
Feb 9, 2021
Merged

Add a --root CLI argument #56

merged 2 commits into from
Feb 9, 2021

Conversation

mpizenberg
Copy link
Owner

elm-test-rs was already able to pick up an elm.json in a parent directory, but not in a subdirectory. You can now run elm-test-rs from outside of the project and add the --root /path/to/elm.json/directory option and it should work as if you run elm-test-rs from that directory.

This is in response to the following comment: https://discourse.elm-lang.org/t/gathering-feedback-on-elm-test-rs-before-1-0-release/6851/7

@mpizenberg mpizenberg mentioned this pull request Feb 5, 2021
12 tasks
@harrysarson
Copy link
Collaborator

In terms of the CLI flag there is precident (I am thinking of make) for a -C DIR flag which changes to the directory before the rest of the program runs. For consistancy it might we worth copying this pattern for elm-test-rs. Just a thought :)


For reference:

       -C dir, --directory=dir
            Change to directory dir before reading the makefiles or
            doing anything else.  If multiple -C options are specified,
            each is interpreted relative to the previous one: -C / -C
            etc is equivalent to -C /etc.  This is typically used with
            recursive invocations of make.

@mpizenberg
Copy link
Owner Author

In terms of the CLI flag there is precident (I am thinking of make) for a -C DIR flag which changes to the directory before the rest of the program runs. For consistancy it might we worth copying this pattern for elm-test-rs. Just a thought :)

I didn't know about that, good point. It's not exactly that though since the paths to tests files passed as arguments is still relative to where you run the command ...

@harrysarson
Copy link
Collaborator

since the paths to tests files passed as arguments

Of course ignore me then...


Unless I may propose -p DIR, --project DIR a la typescript. Otherwise root sounds good!

@mpizenberg
Copy link
Owner Author

Unless I may propose -p DIR, --project DIR a la typescript.

--project sounds nice too! I'm not the primary user for this so I'll probably wait for interested people to give their preference.

Also by the way, copying the behavior of gnu make -C could make sense! It's just that not doing it was a rather easy fix XD. What is the behavior of the typescript --project option? Do you have command line arguments with paths to files when using the typescript compiler?

@mpizenberg mpizenberg merged commit d55ee21 into master Feb 9, 2021
@mpizenberg mpizenberg deleted the root-dir branch February 9, 2021 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants