depot/third_party/nixpkgs/pkgs/development/tools/rust/cargo-geiger/update-cargo-lock.sh
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

19 lines
488 B
Bash
Executable file

#!/bin/sh
# This updates cargo-lock.patch for the diesel version listed in default.nix.
set -eu -o verbose
here=$PWD
version=$(cat default.nix | grep '^ version = "' | cut -d '"' -f 2)
checkout=$(mktemp -d)
git clone -b "cargo-geiger-$version" --depth=1 https://github.com/rust-secure-code/cargo-geiger "$checkout"
cd "$checkout"
rm -f rust-toolchain
cargo generate-lockfile
git add -f Cargo.lock
git diff HEAD -- Cargo.lock > "$here"/cargo-lock.patch
cd "$here"
rm -rf "$checkout"