biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / office / trilium / update.sh
blobe292609e3f759433f25783b864776c94b9a3fe1d
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p coreutils curl jq
3 set -euo pipefail
5 cd $(dirname "${BASH_SOURCE[0]}")
7 setKV () {
8 sed -i "s|$2 = \".*\"|$2 = \"${3:-}\"|" $1
11 version=$(curl -s --show-error "https://api.github.com/repos/zadam/trilium/releases/latest" | jq -r '.tag_name' | tail -c +2)
13 # Update desktop application
14 sha256_linux64=$(nix-prefetch-url --quiet https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-${version}.tar.xz)
15 sha256_darwin64=$(nix-prefetch-url --quiet https://github.com/zadam/trilium/releases/download/v${version}/trilium-mac-x64-${version}.zip)
16 setKV ./desktop.nix version $version
17 setKV ./desktop.nix linuxSource.sha256 $sha256_linux64
18 setKV ./desktop.nix darwinSource.sha256 $sha256_darwin64
20 # Update server
21 sha256_linux64_server=$(nix-prefetch-url --quiet https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-server-${version}.tar.xz)
22 setKV ./server.nix version $version
23 setKV ./server.nix serverSource.sha256 $sha256_linux64_server