netease-music-tui: fix Cargo.lock update script
This commit is contained in:
parent
4023fb81dd
commit
73b03b8c0e
1 changed files with 7 additions and 10 deletions
17
pkgs/applications/audio/netease-music-tui/update-cargo-lock.sh
Normal file → Executable file
17
pkgs/applications/audio/netease-music-tui/update-cargo-lock.sh
Normal file → Executable file
|
@ -1,20 +1,17 @@
|
|||
#!nix-shell
|
||||
#!/usr/bin/env 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
|
||||
set -euo pipefail
|
||||
|
||||
here=$PWD
|
||||
version=$(cat default.nix | grep '^ version = "' | cut -d '"' -f 2)
|
||||
here=$(dirname "$0")
|
||||
version=$(grep '^ version = "' "$here/default.nix" | cut -d '"' -f 2)
|
||||
checkout=$(mktemp -d)
|
||||
git clone -b "$version" --depth=1 https://github.com/betta-cyber/netease-music-tui "$checkout"
|
||||
cd "$checkout"
|
||||
git clone -b "v$version" --depth=1 https://github.com/betta-cyber/netease-music-tui "$checkout"
|
||||
|
||||
cargo generate-lockfile
|
||||
git add -f Cargo.lock
|
||||
git diff HEAD -- Cargo.lock > "$here"/cargo-lock.patch
|
||||
cargo generate-lockfile --manifest-path "$checkout/Cargo.toml"
|
||||
cp "$checkout/Cargo.lock" "$here"
|
||||
|
||||
cd "$here"
|
||||
rm -rf "$checkout"
|
||||
|
|
Loading…
Reference in a new issue