How to make Cargo "deploy"

Hi! I'm writing a program that works with different environment files like config.toml, other directories, etc. I would like to collect all files (with executable) in the bin directory. So I need:
cp ./target/debug/my_executable ./bin/ every time I rebuild, then ./bin/my_executable to run from working directory.

Can I make Cargo do it automatically on cargo run and cargo build?

I'd make use of the xtask pattern for this

3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.