about summary refs log tree commit diff
path: root/pkgs/applications/audio/netease-music-tui/update-cargo-lock.sh
blob: b7ca4216ace5f5f14b23d8a4e7708e12c63e7512 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!nix-shell
#!nix-shell -i bash -p coreutils gnugrep git cargo

# This updates cargo-lock.patch for the netease-music-tui 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 "$version" --depth=1 https://github.com/betta-cyber/netease-music-tui "$checkout"
cd "$checkout"

cargo generate-lockfile
git add -f Cargo.lock
git diff HEAD -- Cargo.lock > "$here"/cargo-lock.patch

cd "$here"
rm -rf "$checkout"