-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Problem
I am currently working on a little project developing a runner for various linters and such things in git hooks. While testing I want to run the program in various git repositories but I noticed that cargo run does not seem to offer a way to set a working directory for the binary it creates.
This means I would have to build and then run the binary directly for every code change and test cycle.
I am sure I am not the only one developing a binary that requires a specific working directory during development test runs so I would like to request a parameter to set the working directory to a user-specified directory for the run portion (after the Cargo.toml and build portions,... have been done as usual in the current directory).
Alternatively, if this is not general enough, it might be useful if the user can specify a wrapper program that can then set working directory, user and all kinds of other inherited process parameters (most likely a shell script for simple cases like the working directory).
Proposed Solution
Add an option --working-directory (possibly with a different name to distinguish it from changing cargo's working directory?) that sets the working directory for the binary after the build.
Notes
No response