mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
vigra: add updateScript
This commit is contained in:
@@ -12,6 +12,9 @@
|
||||
libtiff,
|
||||
openexr,
|
||||
python3,
|
||||
writeShellScript,
|
||||
jq,
|
||||
nix-update,
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -69,6 +72,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||
});
|
||||
};
|
||||
updateScript = writeShellScript "update-vigra" ''
|
||||
latestVersion=$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} --fail --silent https://api.github.com/repos/ukoethe/vigra/releases/latest | ${lib.getExe jq} --raw-output .tag_name | sed -E 's/Version-([0-9]+)-([0-9]+)-([0-9]+)/\1.\2.\3/')
|
||||
${lib.getExe nix-update} vigra --version $latestVersion
|
||||
'';
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
||||
Reference in New Issue
Block a user