summary refs log tree commit diff
path: root/pkgs/games/shticker-book-unwritten/update-cargo-lock.sh
blob: ab84bd0abe44b2499598fe80b61396aad0440235 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p cargo coreutils git gnugrep jq

set -eu -o verbose

here=$PWD
version=$(cat unwrapped.nix | grep '^  version = "' | cut -d '"' -f 2)
checkout=$(mktemp -d)
git clone -b "v$version" --depth=1 https://github.com/JonathanHelianthicusDoe/shticker_book_unwritten "$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"