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

# Ref: https://github.com/NixOS/nixpkgs/blob/nixos-21.05/pkgs/applications/audio/netease-music-tui/update-cargo-lock.sh

set -eu -vx

here=$PWD
version=$(rg '^  version = "' default.nix | cut -d '"' -f 2)
checkout=$(mktemp -d)

git clone -b "$version" --depth=1 https://github.com/gmg137/netease-cloud-music-gtk "$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"