-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
implement -C/--chdir flag #1479
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
src/alr/alr-commands.adb
Outdated
Define_Switch (Config, | ||
Command_Line_Chdir_Target_Path'Access, | ||
"-C=", "--chdir=", | ||
"Run Alire in the given directory"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To refer to the command-line tool proper, better use alr
here. (Backticks included as this helps with doc generation later on).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10b7716 - thanks!
I got the test suite running pretty painlessly, and attempted to write a test in fda16e3. I copied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a minor thing to fix.
""" | ||
Test "executable" only appears in --bin initializations | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite common to forget to update this description ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.