mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
discord: fix parsing versions in updateScripts
Discord changed their download URLs and the new code is now more lenient regarding the actual download URL, as all we care about is the version in the URL path. Example: https://ptb.dl2.discordapp.net/apps/linux/0.0.110/discord-ptb-0.0.110.tar.gz ^-----^ This is what we need Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
04e3c70d0e
commit
19afd56032
@ -54,11 +54,8 @@ stdenv.mkDerivation {
|
||||
#!nix-shell -i bash -p curl gnugrep common-updater-scripts
|
||||
set -x
|
||||
set -eou pipefail;
|
||||
url=$(curl -sI "https://discordapp.com/api/download/${
|
||||
builtins.replaceStrings [ "discord-" "discord" ] [ "" "stable" ] pname
|
||||
}?platform=osx&format=dmg" | grep -oP 'location: \K\S+')
|
||||
version=''${url##https://dl*.discordapp.net/apps/osx/}
|
||||
version=''${version%%/*.dmg}
|
||||
url=$(curl -sI -o /dev/null -w '%header{location}' "https://discord.com/api/download/${branch}?platform=osx&format=dmg")
|
||||
version=$(echo $url | grep -oP '/\K(\d+\.){2}\d+')
|
||||
update-source-version ${lib.optionalString (!stdenv.buildPlatform.isDarwin) "pkgsCross.aarch64-darwin."}${pname} "$version" --file=./pkgs/applications/networking/instant-messengers/discord/default.nix --version-key=${branch}
|
||||
'';
|
||||
};
|
||||
|
@ -151,11 +151,8 @@ stdenv.mkDerivation rec {
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl gnugrep common-updater-scripts
|
||||
set -eou pipefail;
|
||||
url=$(curl -sI "https://discordapp.com/api/download/${
|
||||
builtins.replaceStrings [ "discord-" "discord" ] [ "" "stable" ] pname
|
||||
}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+')
|
||||
version=''${url##https://dl*.discordapp.net/apps/linux/}
|
||||
version=''${version%%/*.tar.gz}
|
||||
url=$(curl -sI -o /dev/null -w '%header{location}' "https://discord.com/api/download/${branch}?platform=linux&format=tar.gz")
|
||||
version=$(echo $url | grep -oP '/\K(\d+\.){2}\d+')
|
||||
update-source-version ${pname} "$version" --file=./pkgs/applications/networking/instant-messengers/discord/default.nix --version-key=${branch}
|
||||
'';
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user