tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
gopeed: add update script
nayeko
1 year ago
999400d4
2c678667
+22
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
go
gopeed
package.nix
update.sh
+2
pkgs/by-name/go/gopeed/package.nix
···
68
68
install -Dm644 assets/icon/icon_1024.png $out/share/icons/hicolor/1024x1024/apps/com.gopeed.Gopeed.png
69
69
'';
70
70
71
71
+
passthru.updateScript = ./update.sh;
72
72
+
71
73
meta = metaCommon // {
72
74
mainProgram = "gopeed";
73
75
};
+20
pkgs/by-name/go/gopeed/update.sh
···
1
1
+
#!/usr/bin/env nix-shell
2
2
+
#!nix-shell -I nixpkgs=./. -i bash -p curl gnused jq yq nix bash coreutils nix-update
3
3
+
4
4
+
set -eou pipefail
5
5
+
6
6
+
ROOT="$(dirname "$(readlink -f "$0")")"
7
7
+
8
8
+
latestTag=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/GopeedLab/gopeed/releases/latest | jq --raw-output .tag_name)
9
9
+
latestVersion=$(echo "$latestTag" | sed 's/^v//')
10
10
+
11
11
+
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; gopeed.version or (lib.getVersion gopeed)" | tr -d '"')
12
12
+
13
13
+
if [[ "$currentVersion" == "$latestVersion" ]]; then
14
14
+
echo "package is up-to-date: $currentVersion"
15
15
+
exit 0
16
16
+
fi
17
17
+
18
18
+
nix-update gopeed.libgopeed
19
19
+
20
20
+
curl https://raw.githubusercontent.com/GopeedLab/gopeed/${latestTag}/ui/flutter/pubspec.lock | yq . >$ROOT/pubspec.lock.json