mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 11:53:27 +00:00
16 lines
643 B
Bash
Executable File
16 lines
643 B
Bash
Executable File
#! /usr/bin/env nix-shell
|
|
#! nix-shell -i bash -p curl jq nix-update
|
|
|
|
set -ex
|
|
|
|
curl_github() {
|
|
curl -L ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "$@"
|
|
}
|
|
|
|
latestTag=$(curl_github https://api.github.com/repos/SpacingBat3/Webcord/releases/latest | jq -r ".tag_name")
|
|
latestVersion="$(expr "$latestTag" : 'v\(.*\)')"
|
|
|
|
nix-update --version "$latestVersion" webcord
|
|
electronVersion=$(curl_github "https://raw.githubusercontent.com/SpacingBat3/WebCord/v$latestVersion/package.json" | jq -r ".devDependencies.electron" | sed -r 's|^\^([0-9]+).*|\1|')
|
|
sed -r "/webcord = / s|(electron_)[0-9]+|\1$electronVersion|" -i pkgs/top-level/all-packages.nix
|