venera: add update script
This commit is contained in:
@@ -65,6 +65,8 @@ flutter327.buildFlutterApplication rec {
|
||||
install -Dm0644 ./debian/gui/venera.png $out/share/pixmaps/venera.png
|
||||
'';
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = {
|
||||
description = "Comic reader that support reading local and network comics";
|
||||
homepage = "https://github.com/venera-app/venera";
|
||||
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -I nixpkgs=./. -i bash -p curl gnused jq yq nixVersions.latest bash coreutils nix-update
|
||||
|
||||
set -eou pipefail
|
||||
|
||||
ROOT="$(dirname "$(readlink -f "$0")")"
|
||||
|
||||
latestTag=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/venera-app/venera/releases/latest | jq --raw-output .tag_name)
|
||||
latestVersion=$(echo "$latestTag" | sed 's/^v//')
|
||||
|
||||
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; venera.version or (lib.getVersion venera)" | tr -d '"')
|
||||
|
||||
if [[ "$currentVersion" == "$latestVersion" ]]; then
|
||||
echo "package is up-to-date: $currentVersion"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
nix-update venera
|
||||
|
||||
curl https://raw.githubusercontent.com/venera-app/venera/${latestTag}/pubspec.lock | yq . >$ROOT/pubspec.lock.json
|
||||
Reference in New Issue
Block a user