about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/gotify/update-yarn-deps.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/gotify/update-yarn-deps.sh')
-rwxr-xr-xnixpkgs/pkgs/servers/gotify/update-yarn-deps.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/gotify/update-yarn-deps.sh b/nixpkgs/pkgs/servers/gotify/update-yarn-deps.sh
new file mode 100755
index 000000000000..d25b5c429df2
--- /dev/null
+++ b/nixpkgs/pkgs/servers/gotify/update-yarn-deps.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -I nixpkgs=../../../ -i bash -p wget yarn2nix-moretea.yarn2nix
+
+# This script is based upon:
+# pkgs/applications/networking/instant-messengers/riot/update-riot-desktop.sh
+
+set -euo pipefail
+
+if [ "$#" -ne 1 ] || [[ "$1" == -* ]]; then
+	echo "Regenerates the Yarn dependency lock files for the gotify-server package."
+	echo "Usage: $0 <git release tag>"
+	exit 1
+fi
+
+GOTIFY_WEB_SRC="https://raw.githubusercontent.com/gotify/server/$1"
+
+wget "$GOTIFY_WEB_SRC/ui/package.json" -O package.json
+wget "$GOTIFY_WEB_SRC/ui/yarn.lock" -O yarn.lock
+yarn2nix --lockfile=yarn.lock > yarndeps.nix
+rm yarn.lock