mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
vencord: fix update script
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
a76791c8b3
commit
877d23c6b2
@ -1,12 +1,15 @@
|
|||||||
{
|
{
|
||||||
|
curl,
|
||||||
esbuild,
|
esbuild,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
git,
|
git,
|
||||||
|
jq,
|
||||||
lib,
|
lib,
|
||||||
nix-update-script,
|
nix-update,
|
||||||
nodejs,
|
nodejs,
|
||||||
pnpm,
|
pnpm,
|
||||||
stdenv,
|
stdenv,
|
||||||
|
writeShellScript,
|
||||||
buildWebExtension ? false,
|
buildWebExtension ? false,
|
||||||
}:
|
}:
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
@ -69,7 +72,23 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.updateScript = nix-update-script { };
|
# We need to fetch the latest *tag* ourselves, as nix-update can only fetch the latest *releases* from GitHub
|
||||||
|
# Vencord had a single "devbuild" release that we do not care about
|
||||||
|
passthru.updateScript = writeShellScript "update-vencord" ''
|
||||||
|
export PATH="${
|
||||||
|
lib.makeBinPath [
|
||||||
|
curl
|
||||||
|
jq
|
||||||
|
nix-update
|
||||||
|
]
|
||||||
|
}:$PATH"
|
||||||
|
ghTags=$(curl ''${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/Vendicated/Vencord/tags")
|
||||||
|
latestTag=$(echo "$ghTags" | jq -r .[0].name)
|
||||||
|
|
||||||
|
echo "Latest tag: $latestTag"
|
||||||
|
|
||||||
|
exec nix-update --version "$latestTag" "$@"
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Vencord web extension";
|
description = "Vencord web extension";
|
||||||
|
Loading…
Reference in New Issue
Block a user