vicinae: add update script, 0.16.2 -> 0.16.5 (#460926)
This commit is contained in:
@@ -20,13 +20,13 @@
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "vicinae";
|
||||
version = "0.16.2";
|
||||
version = "0.16.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "vicinaehq";
|
||||
repo = "vicinae";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-CNL45FJG8JAtFFbc8V8Hhf+RwZuWXFwz/v5E1yAi1bQ=";
|
||||
hash = "sha256-smhbchRZmp7DwRLGA3QoI12kQuMVaxiNkhzfC+n19+4=";
|
||||
};
|
||||
|
||||
apiDeps = fetchNpmDeps {
|
||||
@@ -90,6 +90,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
}"
|
||||
];
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = {
|
||||
description = "A focused launcher for your desktop — native, fast, extensible";
|
||||
homepage = "https://github.com/vicinaehq/vicinae";
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p coreutils curl common-updater-scripts jq prefetch-npm-deps
|
||||
# shellcheck shell=bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
version=$(curl -s "https://api.github.com/repos/vicinaehq/vicinae/releases/latest" | jq -r ".tag_name" | tr -d v)
|
||||
|
||||
if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then
|
||||
echo "Already up to date!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pushd "$(mktemp -d)"
|
||||
curl -s "https://raw.githubusercontent.com/vicinaehq/vicinae/v${version}/typescript/api/package-lock.json" -o api-package-lock.json
|
||||
curl -s "https://raw.githubusercontent.com/vicinaehq/vicinae/v${version}/typescript/extension-manager/package-lock.json" -o extension-manager-package-lock.json
|
||||
newApiDepsHash=$(prefetch-npm-deps api-package-lock.json)
|
||||
newExtensionManagerDepsHash=$(prefetch-npm-deps extension-manager-package-lock.json)
|
||||
popd
|
||||
|
||||
PACKAGE_ROOT=$(dirname "${BASH_SOURCE[0]}")
|
||||
NIXPKGS_ROOT=$(realpath "$PACKAGE_ROOT"/../../../..)
|
||||
|
||||
oldApiDepsHash=$(nix-instantiate --eval --strict --expr \
|
||||
"(import \"$NIXPKGS_ROOT\" {}).vicinae.apiDeps.hash" | tr -d '"')
|
||||
oldExtensionManagerDepsHash=$(nix-instantiate --eval --strict --expr \
|
||||
"(import \"$NIXPKGS_ROOT\" {}).vicinae.extensionManagerDeps.hash" | tr -d '"')
|
||||
|
||||
update-source-version vicinae "$version"
|
||||
sed -i "s@$oldApiDepsHash@$newApiDepsHash@g" "$PACKAGE_ROOT"/package.nix
|
||||
sed -i "s@$oldExtensionManagerDepsHash@$newExtensionManagerDepsHash@g" "$PACKAGE_ROOT"/package.nix
|
||||
Reference in New Issue
Block a user