Skip to content

Commit

Permalink
grandperspective: add update script
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarNestorov committed Dec 27, 2024
1 parent f6d6bec commit c9ac7e4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkgs/by-name/gr/grandperspective/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
fetchurl,
undmg,
makeWrapper,
writeShellApplication,
curl,
cacert,
gnugrep,
common-updater-scripts,
}:

stdenv.mkDerivation (finalAttrs: {
Expand All @@ -29,6 +34,21 @@ stdenv.mkDerivation (finalAttrs: {
makeWrapper "$out/Applications/GrandPerspective.app/Contents/MacOS/GrandPerspective" "$out/bin/grandperspective"
'';

passthru.updateScript = lib.getExe (writeShellApplication {
name = "grandperspective-update-script";
runtimeInputs = [
curl
cacert
gnugrep
common-updater-scripts
];
text = ''
url="https://sourceforge.net/p/grandperspectiv/documentation/ci/master/tree/CHANGES.txt?format=raw"
version=$(curl -s "$url" | grep -oP 'Version \K[0-9.]+(?=,)' | head -n 1)
update-source-version grandperspective "$version"
'';
});

meta = with lib; {
description = "Open-source macOS application to analyze disk usage";
longDescription = ''
Expand Down

0 comments on commit c9ac7e4

Please sign in to comment.