Travis has an environment variable for that. I decided to write a simple shell script and used it just as one would use cargo
:
if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then
cargo $@ --features nightly
else
cargo $@
fi
calling it like this:
sh scripts/cargo.sh build -v
There may be a more robust solution, but this works fine for simple situations like this.