Closed simonbuchan closed 7 months ago
There's probably a nicer way to do exit code handling in powershell, but it's a surprisingly messy problem: https://stackoverflow.com/questions/57468522/powershell-and-process-exit-codes
Another option would be to do the equivalent of cargo build --manifest-path build_system/Cargo.toml -- "$@"
in bash. This will handle errors without any work from cmd.exe or powershell.
If you can use an MSYS bash (e.g. Git for Windows'), then ./y.sh
should work. But by default bash
will run WSL in windows which doesn't work (performance aside it will not find cargo.exe
when looking for cargo
), and I think by default Git for Windows will not put it's bash on the path.
I mean you could translate cargo build --manifest-path build_system/Cargo.toml -- "$@"
from bash syntax to cmd and powershell syntax.
Well the issue is not running the built binary after building it, and ideally returning the exit code from the wrapper script. It doesn't matter if that's from rustc or cargo at that point.
Do you mean cargo run --manifest-path ...?
Do you mean cargo run --manifest-path ...?
Yes
Right, though I'd prefer if y.sh matched, and you would still want the wrapper to return the exit code too, so it's only a minor improvement.
Just a little bit to make windows dev a bit nicer. This makes
.\y ...
work in powershell and cmd, andy ...
work in cmd.I assume others are using git bash or something?