irpf: add update script
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
, makeWrapper
|
||||
, unzip
|
||||
, xdg-utils
|
||||
, writeScript
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
@@ -22,6 +23,16 @@ stdenvNoCC.mkDerivation rec {
|
||||
hash = "sha256-7Eh5XhZKs2DAQC33ICUG+mgjEU7H3jdYZSeiHNJ6I6Q=";
|
||||
};
|
||||
|
||||
passthru.updateScript = writeScript "update-irpf" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl pup common-updater-scripts
|
||||
|
||||
set -eu -o pipefail
|
||||
#parses the html with the install links for the containers that contain the instalation files of type 'file archive, gets the version number of each version, and sorts to get the latest one on the website
|
||||
version="$(curl -s https://www.gov.br/receitafederal/pt-br/centrais-de-conteudo/download/pgd/dirpf | pup '.rfb_container .rfb_ositem:parent-of(.fa-file-archive) attr{href}' | grep -oP "IRPF\K(\d+)-[\d.]+\d" | sort -r | head -1)"
|
||||
update-source-version irpf "$version"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ unzip makeWrapper copyDesktopItems ];
|
||||
|
||||
desktopItems = [
|
||||
|
||||
Reference in New Issue
Block a user