Furthermore, please consider changing #!/bin/bash to #!/usr/bin/env bash. The latter one works on almost all Unix like systems, the first one does not work on serveral BSDs and NixOS, for example.
Edit: Please do the shebang change on all occurrences. Building a rust project does also not work, due to
/bin/bash -lc '/usr/local/bin/cargo run --verbose' trying to run /bin/bash instead of /usr/bin/env bash.
Edit 2: I see that you are running commands through bash. Why do you run bash to run rustc inside of bash?
Edit 3: It looks like almost all of the paths are hard coded. Why that? Is there a rational reason against letting the given system environment determine, where to find a cargo binary?
To build on NixOS, one must run
Furthermore, please consider changing
#!/bin/bash
to#!/usr/bin/env bash
. The latter one works on almost all Unix like systems, the first one does not work on serveral BSDs and NixOS, for example.Edit: Please do the shebang change on all occurrences. Building a rust project does also not work, due to
/bin/bash -lc '/usr/local/bin/cargo run --verbose'
trying to run/bin/bash
instead of/usr/bin/env bash
.Edit 2: I see that you are running commands through
bash
. Why do you run bash to runrustc
inside ofbash
?Edit 3: It looks like almost all of the paths are hard coded. Why that? Is there a rational reason against letting the given system environment determine, where to find a
cargo
binary?