Skip to content

Commit

Permalink
ps3-disc-dumper: add update script
Browse files Browse the repository at this point in the history
  • Loading branch information
gepbird committed Dec 3, 2024
1 parent 99d63c4 commit 248a2f2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/by-name/ps/ps3-disc-dumper/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ buildDotnetModule rec {
openssl
];

passthru.updateScript = ./update.sh;

meta = with lib; {
homepage = "https://github.com/13xforever/ps3-disc-dumper";
description = "Handy utility to make decrypted PS3 disc dumps";
Expand Down
19 changes: 19 additions & 0 deletions pkgs/by-name/ps/ps3-disc-dumper/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts
set -eo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"

new_version="$(curl -s "https://api.github.com/repos/13xforever/ps3-disc-dumper/releases?per_page=1" | jq -r '.[0].tag_name | ltrimstr("v")')"
old_version="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./package.nix)"
if [[ "$new_version" == "$old_version" ]]; then
echo "Up to date"
exit 0
fi

cd ../../../..

if [[ "$1" != "--deps-only" ]]; then
update-source-version ps3-disc-dumper "$new_version"
fi

$(nix-build . -A ps3-disc-dumper.fetch-deps --no-out-link)

0 comments on commit 248a2f2

Please sign in to comment.