-
Notifications
You must be signed in to change notification settings - Fork 31k
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
src: add --run-dir
runtime flag
#57523
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
The commit message doesn't adhere to our guidelines, it should start with an imperative verb so e.g. |
cc @flakey5 |
We need to also change the pull-request title and description to reflect the changes. |
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
2b7efd1
to
75b88f0
Compare
--run-in
runtime flag--run-directory
runtime flag
--run-directory
runtime flag--run-in-directory
runtime flag
ddc39f0
to
8d8a3e5
Compare
Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
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.
LGTM if tests pass (and the new requested test is added)
--run-in-directory
runtime flag--run-dir
runtime flag
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #57523 +/- ##
==========================================
+ Coverage 90.22% 90.24% +0.01%
==========================================
Files 629 629
Lines 184845 184955 +110
Branches 36205 36234 +29
==========================================
+ Hits 166784 166915 +131
+ Misses 11016 11014 -2
+ Partials 7045 7026 -19
🚀 New features to boost your workflow:
|
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Can you add a test that uses |
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@@ -1216,6 +1216,9 @@ PerProcessOptionsParser::PerProcessOptionsParser( | |||
AddOption("--run", | |||
"Run a script specified in package.json", | |||
&PerProcessOptions::run); | |||
AddOption("--run-dir", |
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.
I've seen that this has already been raised. While I don't have a better name in mind, I think the current name is misleading
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.
I agree with @GeoffreyBooth suggestion
--run-path
+1
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.
I will wait for further advice for the collective decision; please feel free to give suggestion 🚀
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.
@mertcanaltin , IMHO the most common term used in such context is working_directory
or working_dir
.
E.g. "cwd" stands for "current working directory", "pwd" - "print working directory", etc.
Another example is the WORKING_DIRECTORY
attribute used by CMake.
The new code would read: cwd = node::per_process::cli_options->working_dir;
I believe it is more natural than cwd = node::per_process::cli_options->run_dir;
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.
The --cwd
is also a great name proposed above by @targos
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.
Please disregard my previous posts. I read through the discussion in the linked issue and see why the "working directory" term is not used. I am actually puzzled why the new flag is needed at all. Users can always provide the full path for the --run
parameter.
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.
@vmoroz, thank you very much for your suggestions. I think adding this flag gives users an easy and clear way to specify the correct directory and ensures that commands work in the intended context. This extra flexibility can provide a good experience in scenarios where precise control over the working directory is needed, such as when running new API documentation tools.
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
I'm not opposed to this feature, but there are multiple requests for renaming, from different people: #57523 (comment), #57523 (comment), #57523 (comment), #57523 (comment). There also seems to be some confusion/lack of consensus about whether this should only affect I'd like to see this land in some form, so I don't want to block this, but I think the above should be resolved before someone lands this. |
We can land this as experimental, and later iterate on this. New documentation infra changes require this to be implemented, so I recommend merging and iterating. |
This flag currently lacks |
add
--run-dir
runtime flagFixes #57489