owmods-cli: 0.10.0 -> 0.11.2
This commit is contained in:
parent
397b1733f4
commit
8a837dd7fa
3 changed files with 284 additions and 233 deletions
475
pkgs/applications/misc/owmods-cli/Cargo.lock
generated
475
pkgs/applications/misc/owmods-cli/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -11,13 +11,13 @@
|
|||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "owmods-cli";
|
||||
version = "0.10.0";
|
||||
version = "0.11.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ow-mods";
|
||||
repo = "ow-mod-man";
|
||||
rev = "cli_v${version}";
|
||||
hash = "sha256-kumYLlp2LRqTQz23N9lriJJf7x2pPXbqqUvkiAhyMDY=";
|
||||
hash = "sha256-kjHGuVYX9pKy2I+m347cEdPj6MjCDz8vz2Cnce9+z90=";
|
||||
};
|
||||
|
||||
cargoLock = {
|
||||
|
|
38
pkgs/applications/misc/owmods-cli/update.sh
Executable file
38
pkgs/applications/misc/owmods-cli/update.sh
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl gnused nix-prefetch nix-prefetch-github jq wget
|
||||
|
||||
#modified version of https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/servers/readarr/update.sh
|
||||
set -e
|
||||
|
||||
dirname="$(dirname "$0")"
|
||||
|
||||
updateHash()
|
||||
{
|
||||
version=$1
|
||||
|
||||
url="https://github.com/ow-mods/ow-mod-man/releases/cli_v$version"
|
||||
prefetchJson=$(nix-prefetch-github ow-mods ow-mod-man --rev cli_v$version)
|
||||
sha256="$(echo $prefetchJson | jq -r ".sha256")"
|
||||
echo "sha256=${sha256}"
|
||||
|
||||
sed -i "s/hash = \"[a-zA-Z0-9\/+-=]*\";/hash = \"sha256-$sha256\";/g" "$dirname/default.nix"
|
||||
|
||||
#downloads and replaces .lock file
|
||||
wget https://raw.githubusercontent.com/ow-mods/ow-mod-man/cli_v$version/Cargo.lock -q -O $dirname/Cargo.lock
|
||||
|
||||
}
|
||||
|
||||
updateVersion()
|
||||
{
|
||||
sed -i "s/version = \"[0-9.]*\";/version = \"$1\";/g" "$dirname/default.nix"
|
||||
}
|
||||
|
||||
latestTag=$(curl https://api.github.com/repos/ow-mods/ow-mod-man/releases | jq -r ".[0].tag_name")
|
||||
latestVersion="$(expr $latestTag : 'gui_v\(.*\)')"
|
||||
echo "latest version: ${latestVersion}"
|
||||
|
||||
echo "updating..."
|
||||
updateVersion $latestVersion
|
||||
|
||||
updateHash $latestVersion
|
||||
echo "updated cli"
|
Loading…
Reference in a new issue