#!/bin/sh

set -ex

if ischroot
then
    exit 0
fi

rm -rf .cargo vendor
mkdir .cargo
cargo vendor --locked --sync Cargo.toml | head -n -1 > .cargo/config.toml
echo 'directory = "vendor"' >> .cargo/config.toml
echo >> .cargo/config.toml
tar pcf vendor.tar .cargo vendor
rm -rf .cargo vendor
