Skip to content

Commit 18214c6

Browse files
emarynemaryn
authored andcommitted
cherry-studio: update update script
1 parent eaa8c08 commit 18214c6

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

pkgs/by-name/ch/cherry-studio/package.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
writableTmpDirAsHomeHook,
1010
makeDesktopItem,
1111
copyDesktopItems,
12-
nix-update-script,
1312
commandLineArgs ? "",
1413
}:
1514

@@ -112,7 +111,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
112111
runHook postInstall
113112
'';
114113

115-
passthru.updateScript = nix-update-script { };
114+
passthru.updateScript = ./update.sh;
116115

117116
meta = {
118117
description = "Desktop client that supports for multiple LLM providers";
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env nix-shell
2+
#!nix-shell -i bash -p curl gnused jq nix bash coreutils nix-update
3+
4+
set -eou pipefail
5+
6+
latestTag=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/CherryHQ/cherry-studio/releases/latest | jq --raw-output .tag_name)
7+
latestVersion=$(echo "$latestTag" | sed 's/^v//')
8+
9+
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; cherry-studio.version or (lib.getVersion cherry-studio)" | tr -d '"')
10+
11+
if [[ "$currentVersion" == "$latestVersion" ]]; then
12+
echo "package is up-to-date: $currentVersion"
13+
exit 0
14+
fi
15+
16+
nix-update cherry-studio --version "$latestVersion"

0 commit comments

Comments
 (0)