Merge pull request #85086 from bhipple/u/discord
discord-{ptb,canary}: update to latest versions and fixup updateScript
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# script to generate `pkgs/networking/instant-messengers/discord/default.nix`
|
||||
|
||||
set -e
|
||||
exec >${1:?usage: $0 <output-file>}
|
||||
|
||||
cat <<EOF
|
||||
{ branch ? "stable", pkgs }:
|
||||
# Generated by /maintainers/scripts/update-discord
|
||||
let
|
||||
inherit (pkgs) callPackage fetchurl;
|
||||
in {
|
||||
EOF
|
||||
|
||||
for branch in "" ptb canary; do
|
||||
url=$(curl -sI "https://discordapp.com/api/download${branch:+/}${branch}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+')
|
||||
version=${url##https://dl*.discordapp.net/apps/linux/}
|
||||
version=${version%%/*.tar.gz}
|
||||
echo " ${branch:-stable} = callPackage ./base.nix rec {"
|
||||
echo " pname = \"discord${branch:+-}${branch}\";"
|
||||
case $branch in
|
||||
"") suffix="" ;;
|
||||
ptb) suffix="PTB" ;;
|
||||
canary) suffix="Canary" ;;
|
||||
esac
|
||||
echo " binaryName = \"Discord${suffix}\";"
|
||||
echo " desktopName = \"Discord${suffix:+ }${suffix}\";"
|
||||
echo " version = \"${version}\";"
|
||||
echo " src = fetchurl {"
|
||||
echo " url = \"${url//${version}/\$\{version\}}\";"
|
||||
echo " sha256 = \"$(nix-prefetch-url "$url")\";"
|
||||
echo " };"
|
||||
echo " };"
|
||||
done
|
||||
|
||||
echo "}.\${branch}"
|
||||
Reference in New Issue
Block a user