#!/bin/sh
# 1. Pull the latest code
git pull

# 2. Wipe the old, outdated vendor directory completely
rm -rf vendor/ .cargo/

# 3. Download the new dependencies and generate clean checksums
cargo vendor

# 4. Re-create the offline config layout
mkdir -p .cargo
cat << EOF > .cargo/config.toml
[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
EOF
