Unverified Commit bc23fd0a authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

_010editor: add updatescript (#493167)

parents a1b8933f f6cd0e20
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
  qt6,
  undmg,
  xkeyboard-config,
  writeScript,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -105,6 +106,21 @@ stdenv.mkDerivation (finalAttrs: {
    };
  };

  passthru = {
    updateScript = writeScript "update-010editor" ''
      #!/usr/bin/env nix-shell
      #!nix-shell -i bash -p curl pcre2 common-updater-scripts

      set -eu -o pipefail

      # Expect the text in format of "Version: major.minor.patchlevel
      newVersion="$(curl -s https://sweetscape.com/download/010editor/ | pcre2grep -o1 'Version: ([0-9]+\.[0-9]+\.[0-9]+)' | sort -u)"
      for platform in ${toString finalAttrs.meta.platforms}; do
        update-source-version _010editor "$newVersion" --source-key=passthru.srcs.$platform --ignore-same-version
      done
    '';
  };

  meta = {
    description = "Text and hex editor";
    homepage = "https://www.sweetscape.com/010editor/";