implement -C/--chdir flag#1479
Conversation
mosteo
left a comment
There was a problem hiding this comment.
This looks good to me, but indeed we would need a new test. For this feature it should be quite simple and I can guide you. First thing is, are you able to run the testsuite now? You can get started with the README in the testsuite folder.
| Define_Switch (Config, | ||
| Command_Line_Chdir_Target_Path'Access, | ||
| "-C=", "--chdir=", | ||
| "Run Alire in the given directory"); |
There was a problem hiding this comment.
To refer to the command-line tool proper, better use alr here. (Backticks included as this helps with doc generation later on).
|
I got the test suite running pretty painlessly, and attempted to write a test in fda16e3. I copied |
mosteo
left a comment
There was a problem hiding this comment.
Looks good to me, just a minor thing to fix.
| """ | ||
| Test "executable" only appears in --bin initializations | ||
| """ |
There was a problem hiding this comment.
Quite common to forget to update this description ;-)
There was a problem hiding this comment.
Thanks for catching that - fixed in cba2c11, which also tests -C behavior on a non-existent directory. Thanks!
| # Check that it builds and runs | ||
| run_alr("--chdir=xxx", "run") |
There was a problem hiding this comment.
Also, it would be good to have a check after this one that when the target directory doesn't exist, alr exits with error.
|
Thanks, @atalii |
|
Hi @atalii, it would be nice to have a user "User-facing changes" entry for this: https://github.com/alire-project/alire/blob/master/doc/user-changes.md |
Fixes #1478.
This is my first contribution to any actual code, so expect it to be rough. I imagine for a start we'd want tests for this, as well as actual error messages.