-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
Hashbang-callable and automatically suppresses cargo compile messages except on compile error. i.e. STDOUT (and stderr) of executing a successfully-compilable script is always just the product of the compiled script's execution.
This is so for bash, python, etc. scripts which other programs/scripts execute directly and use the stdout, a rust file+cargo-script can be used as a drop-in replacement.
#!/bin/sh
# cargo-script-run
if ! results=`cargo script --build-only $1 2>&1`; then
echo -e "$results"
exit 1
fi
cargo script $@
exit 0OTOH I can see the value of saying "if you're going to be using it as an executable called by other programs, make it into an actual rust project." So it's just an idea.
Metadata
Metadata
Assignees
Labels
No labels