platformsh: fix version parsing with nix-env

This commit is contained in:
Sandro Jäckel 2022-04-30 02:32:29 +02:00
parent 9b310a73db
commit 4aa7c71088
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5

View file

@ -2,13 +2,13 @@
let
pname = "platformsh";
version = "v3.79.0";
version = "3.79.0";
in
stdenv.mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/platformsh/platformsh-cli/releases/download/${version}/platform.phar";
url = "https://github.com/platformsh/platformsh-cli/releases/download/v${version}/platform.phar";
sha256 = "sha256-gTh1VS/b+D8E67w6Q4u9h0EhpFZiA2gBGe4mo49+9KY=";
};
@ -31,7 +31,7 @@ stdenv.mkDerivation {
export PATH="${lib.makeBinPath [ curl jq common-updater-scripts ]}"
NEW_VERSION=$(curl -s https://api.github.com/repos/platformsh/platformsh-cli/releases/latest | jq .tag_name --raw-output)
if [[ "${version}" = "$NEW_VERSION" ]]; then
if [[ "v${version}" = "$NEW_VERSION" ]]; then
echo "The new version same as the old version."
exit 0
fi