Skip to content

Commit c9ac7e4

Browse files
grandperspective: add update script
1 parent f6d6bec commit c9ac7e4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pkgs/by-name/gr/grandperspective/package.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
fetchurl,
55
undmg,
66
makeWrapper,
7+
writeShellApplication,
8+
curl,
9+
cacert,
10+
gnugrep,
11+
common-updater-scripts,
712
}:
813

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

37+
passthru.updateScript = lib.getExe (writeShellApplication {
38+
name = "grandperspective-update-script";
39+
runtimeInputs = [
40+
curl
41+
cacert
42+
gnugrep
43+
common-updater-scripts
44+
];
45+
text = ''
46+
url="https://sourceforge.net/p/grandperspectiv/documentation/ci/master/tree/CHANGES.txt?format=raw"
47+
version=$(curl -s "$url" | grep -oP 'Version \K[0-9.]+(?=,)' | head -n 1)
48+
update-source-version grandperspective "$version"
49+
'';
50+
});
51+
3252
meta = with lib; {
3353
description = "Open-source macOS application to analyze disk usage";
3454
longDescription = ''

0 commit comments

Comments
 (0)