123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #!/usr/bin/env bash
- set -e
- HERE=$(dirname "$(realpath "$0")")
- TOPLEVEL=$(dirname "$(dirname "$HERE")")
- TOML="$TOPLEVEL/src/rust/Cargo.toml"
- VENDORED="$TOPLEVEL/src/ext/rust/crates"
- CARGO=$(command -v cargo)
- if ! test -f "$TOML" ; then
- printf "Error: Couldn't find workspace Cargo.toml in expected location: %s\\n" "$TOML"
- fi
- if ! test -d "$VENDORED" ; then
- printf "Error: Couldn't find directory for Rust dependencies! Expected location: %s\\n" "$VENDORED"
- fi
- if test -z "$CARGO" ; then
- printf "Error: cargo must be installed and in your \$PATH\\n"
- fi
- if test -z "$(cargo --list | grep vendor)" ; then
- printf "Error: cargo-vendor not installed\\n"
- fi
- $CARGO vendor -v --locked --explicit-version --no-delete --sync "$TOML" "$VENDORED"
|