2018-11-11 08:19:04 -08:00
|
|
|
#!/usr/bin/env bash
|
2018-07-26 10:14:25 -07:00
|
|
|
#
|
|
|
|
# Audits project dependencies for security vulnerabilities
|
|
|
|
#
|
2018-11-11 09:25:59 -08:00
|
|
|
set -e
|
2018-07-26 10:14:25 -07:00
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
|
|
|
export RUST_BACKTRACE=1
|
|
|
|
rustc --version
|
|
|
|
cargo --version
|
|
|
|
|
|
|
|
_() {
|
|
|
|
echo "--- $*"
|
|
|
|
"$@"
|
|
|
|
}
|
|
|
|
|
2018-12-08 19:14:19 -08:00
|
|
|
cargo_install_unless() {
|
|
|
|
declare crate=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
"$@" > /dev/null 2>&1 || \
|
|
|
|
_ cargo install "$crate"
|
2018-07-26 10:14:25 -07:00
|
|
|
}
|
|
|
|
|
2018-12-08 19:14:19 -08:00
|
|
|
cargo_install_unless cargo-audit cargo audit --version
|
2018-07-26 10:14:25 -07:00
|
|
|
|
2018-09-28 16:50:06 -07:00
|
|
|
_ cargo audit
|